Methods
(static) cloneTextTemplateAsCustom(textTemplateId, referenceApplicationName, referenceType, referenceId, titleSuffix, token) → {TextTemplate}
Function that save the text template
Parameters:
| Name | Type | Description |
|---|---|---|
textTemplateId |
string | Required by the action: the id of the text tamplate |
referenceApplicationName |
string | Required by the action: the reference to the stage object |
referenceType |
string | Required by the action: the reference to the stage object |
referenceId |
string | Required by the action: the reference to the stage object |
titleSuffix |
string | Optional for the action: the suffix of the new title |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/clone-text-template-as-custom
Returns:
return the text template
- Type
- TextTemplate
(static) countTextTemplateList(textTemplateType, searchedText, textTemplateId, referenceApplicationName, referenceType, referenceId, token) → {number}
Counts the text templates filtering by the specified parameters
Parameters:
| Name | Type | Description |
|---|---|---|
textTemplateType |
string | Array.<string> | Required: Text template type(s) |
searchedText |
string | Optional: The name of the template to search |
textTemplateId |
string | Array.<string> | Optional: Text template id(s) used to filter on the records |
referenceApplicationName |
string | Array.<string> | Optional: The reference application |
referenceType |
string | Array.<string> | Optional: The reference type |
referenceId |
string | Array.<string> | Optional: The reference id |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/count-text-template-list
Returns:
Counter of the mathing templates
- Type
- number
(static) deleteTextTemplate(textTemplateId, token) → {number}
Function that delete the text template
Parameters:
| Name | Type | Description |
|---|---|---|
textTemplateId |
string | Required by the action: The text template id |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/delete-text-template/:textTemplateId
Returns:
return the text template counter
- Type
- number
(static) getAllTextTemplates(textTemplateType, getInlineStyle, fromRecord, numRecords, allData, token) → {TextTemplate}
Function that retrieve the list of text-template
Parameters:
| Name | Type | Description |
|---|---|---|
textTemplateType |
string | Array.<string> | Required: Text template type(s) |
getInlineStyle |
boolean | Optional by the action: If true, it will convert the classes of the html into inline style |
fromRecord |
number | Required by the action: The number of the first record to load (exclusive - 0 to start from the first) |
numRecords |
number | Required by the action: The number of records to load |
allData |
boolean | Optional for the action: If passed with true value, all data will be returned (fromRecord and numRecords are not required) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/get-all-text-templates
Returns:
return the text template
- Type
- TextTemplate
(static) getGenericTextTemplate(token) → {TextTemplate}
Function that retrieve the generic text-templte
Parameters:
| Name | Type | Description |
|---|---|---|
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/get-generic-text-template
Returns:
return the text template
- Type
- TextTemplate
(static) getMailSignatureTextByIdForPublic(userId, textTemplateId) → {string}
Retrieves the text of a mail signature template using the langCode of the user NB: This is a public method, so anyone can use it
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | Required: Id of the user who's retrieving the template |
textTemplateId |
string | Required: Id of the text template to retrieve |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/get-mail-signature-text-by-id-for-public
Returns:
The localized text of the template
- Type
- string
(static) getTextTemplateById(textTemplateId, precalculatedMarkersObjects, token) → {TextTemplate}
Function that retrieve the text template
Parameters:
| Name | Type | Description |
|---|---|---|
textTemplateId |
string | Required by the action: The text template id |
precalculatedMarkersObjects |
any | Optional: markers objects to use in order to create precalculated markers |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/get-text-template-by-id/:textTemplateId
Returns:
return the text template
- Type
- TextTemplate
(static) listMailTemplates(textTemplateType, searchedText, textTemplateId, referenceApplicationName, referenceType, referenceId, lazyLoadLangs, skipTemplateText, customVersionReferenceApplicationName, customVersionReferenceType, customVersionReferenceId, token) → {Array.<TextTemplate>}
Retrieves the text templates filtering by the specified parameters. By default, the text template langs will be retrieved too.
Parameters:
| Name | Type | Description |
|---|---|---|
textTemplateType |
string | Array.<string> | Required: Text template type(s) |
searchedText |
string | Optional: The name of the template to search |
textTemplateId |
string | Array.<string> | Optional: Text template id(s) used to filter on the records |
referenceApplicationName |
string | Array.<string> | Optional: The reference application |
referenceType |
string | Array.<string> | Optional: The reference type |
referenceId |
string | Array.<string> | Optional: The reference id |
lazyLoadLangs |
boolean | Optional: If true, the text template langs won't be retrieved |
skipTemplateText |
boolean | Optional: If true, the text template langs text won't be retrieved |
customVersionReferenceApplicationName |
string | Array.<string> | Optional: The reference application of the stage to load its custom version template |
customVersionReferenceType |
string | Array.<string> | Optional: The reference type of the stage to load its custom version template |
customVersionReferenceId |
string | Array.<string> | Optional: The reference id of the stage to load its custom version template |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP GET /rest-api/corporateacademy-mediator/list-mail-templates
Returns:
Array with the matching text templates
- Type
- Array.<TextTemplate>
(static) saveTextTemplate(getInlineStyle, token) → {string}
Function that save the text template
Parameters:
| Name | Type | Description |
|---|---|---|
getInlineStyle |
boolean | Optional by the action: If true, it will convert the classes of the html into inline style |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/save-text-template
Returns:
return the text template id
- Type
- string