Methods
(static) askForManagersValidation(syllabusItemId, stageItemId, editionItemId, managerIds, mailSenderId, mailCC, mailBCC, signatureId, messageBodyAddOn, textTemplateId, managerType, testOnly, token) → {boolean}
Sends a mail to the specified managers to ask them to validate the users of the specified edition before the approval's deadline
Parameters:
| Name | Type | Description |
|---|---|---|
syllabusItemId |
string | Required: Id of the syllabus |
stageItemId |
string | Required: Id of the stage |
editionItemId |
string | Required: Id of edition |
managerIds |
Array.<string> | Required: Ids of the managers to notify |
mailSenderId |
string | Required: If of the mail sender to use |
mailCC |
string | Optional: CC's of the mails |
mailBCC |
string | Optional: BCC's of the mails |
signatureId |
string | Required: Id of the signature template to use. It will be added as a marker. |
messageBodyAddOn |
string | Optional: Additional text. It will be added as a marker. |
textTemplateId |
string | Required: Id of the mail template to use |
managerType |
string | Required: Type of the managers to notify. The available types are defined in the ManagerTypes enum in the atfcore-commonclasses project |
testOnly |
boolean | Optional: If true, only one mail will be generated and sent to the logged user (for testing purposes) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/ask-for-managers-validation
Returns:
Return true if no errors were thrown during the execution
- Type
- boolean
(static) countMailSenders(token) → {Array.<MailSender>}
Retrieves all the mail senders that can be used by the user
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/count-mail-senders
Returns:
Array with the retrieved mail senders
- Type
- Array.<MailSender>
(static) deleteMailSender(mailSenderId, token) → {void}
Deletes a mail sender
Parameters:
| Name | Type | Description |
|---|---|---|
mailSenderId |
string | Required: The id of the mail sender to retrieve |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/delete-mail-sender/:mailSenderId
Returns:
null
- Type
- void
(static) getLastProposalRequestMail(supplierTaskId, token) → {MailQueue}
Retrieves the last proposal request email sent for the specified proposal
Parameters:
| Name | Type | Description |
|---|---|---|
supplierTaskId |
string | Required: The id of the proposal (that is a supplier task) |
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-last-proposal-request-mail/:supplierTaskId
Returns:
The last mail, referenced to the specified proposal, that has been sent by the logged user
- Type
- MailQueue
(static) getMailSender(token) → {Array.<MailSender>}
Retrieves all the mail senders that can be used by the user
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-mail-sender/:mailSenderId
Returns:
Array with the retrieved mail senders
- Type
- Array.<MailSender>
(static) getSentMailFromReference(userId, mailType, referenceType, referenceId, token) → {MailQueue}
Retrieves the last sent mail for the specified cross-reference
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
string | Required: Id of the user who received the mail (the mail's recipient) |
mailType |
string | Required: Type of the mail to retrieve |
referenceType |
string | Required: Cross-reference's type |
referenceId |
string | Required: Cross-reference's 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/get-sent-mail-from-reference
Returns:
The retrived mail object
- Type
- MailQueue
(static) inviteTakers(syllabusItemId, stageItemId, takerIds, mailSenderId, mailCC, mailBCC, signatureId, messageBodyAddOn, textTemplateId, testOnly, token) → {boolean}
Sends an invite mail to the specified takers to invite them to the specified editions. If no existing enrolls are found, a new one will be created. Otherwise, a new status with be logged for the found ones.
Parameters:
| Name | Type | Description |
|---|---|---|
syllabusItemId |
string | Required: Id of the syllabus |
stageItemId |
string | Required: Id of the stage |
takerIds |
Array.<string> | Required: Ids of the takers to invite |
mailSenderId |
string | Required: If of the mail sender to use |
mailCC |
string | Optional: CC's of the mails |
mailBCC |
string | Optional: BCC's of the mails |
signatureId |
string | Required: Id of the signature template to use. It will be added as a marker. |
messageBodyAddOn |
string | Optional: Additional text. It will be added as a marker. |
textTemplateId |
string | Required: Id of the mail template to use |
testOnly |
boolean | Optional: If true, only one mail will be generated and sent to the logged user (for testing purposes) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/invite-takers
Returns:
Return true if no errors were thrown during the execution
- Type
- boolean
(static) inviteTakersForSupplier(syllabusItemId, stageItemId, takerIds, mailSenderId, mailCC, mailBCC, signatureId, messageBodyAddOn, textTemplateId, testOnly, token) → {boolean}
Sends an invite mail to the specified takers to invite them to the specified editions. If no existing enrolls are found, a new one will be created. Otherwise, a new status with be logged for the found ones.
Parameters:
| Name | Type | Description |
|---|---|---|
syllabusItemId |
string | Required: Id of the syllabus |
stageItemId |
string | Required: Id of the stage |
takerIds |
Array.<string> | Required: Ids of the takers to invite |
mailSenderId |
string | Required: If of the mail sender to use |
mailCC |
string | Optional: CC's of the mails |
mailBCC |
string | Optional: BCC's of the mails |
signatureId |
string | Required: Id of the signature template to use. It will be added as a marker. |
messageBodyAddOn |
string | Optional: Additional text. It will be added as a marker. |
textTemplateId |
string | Required: Id of the mail template to use |
testOnly |
boolean | Optional: If true, only one mail will be generated and sent to the logged user (for testing purposes) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/invite-takers-for-supplier
Returns:
Return true if no errors were thrown during the execution
- Type
- boolean
(static) listAvailableMailSignatures(token) → {Array.<MailSender>}
Retrieves all the mail signatures that can be used by the user
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/list-available-mail-signatures
Returns:
Array with the retrieved mail signatures
- Type
- Array.<MailSender>
(static) listMailSenders(token) → {Array.<MailSender>}
Retrieves all the mail senders that can be used by the user
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/list-mail-senders
Returns:
Array with the retrieved mail senders
- Type
- Array.<MailSender>
(static) notifyManagers(syllabusItemId, stageItemId, editionItemId, managerIds, mailSenderId, mailCC, mailBCC, signatureId, messageBodyAddOn, textTemplateId, managerType, testOnly, token) → {boolean}
Sends a notification mail to the specified managers to remind them that some of their subordinates will be involved in a course.
Parameters:
| Name | Type | Description |
|---|---|---|
syllabusItemId |
string | Required: Id of the syllabus |
stageItemId |
string | Required: Id of the stage |
editionItemId |
string | Required: Id of edition |
managerIds |
Array.<string> | Required: Ids of the managers to notify |
mailSenderId |
string | Required: If of the mail sender to use |
mailCC |
string | Optional: CC's of the mails |
mailBCC |
string | Optional: BCC's of the mails |
signatureId |
string | Required: Id of the signature template to use. It will be added as a marker. |
messageBodyAddOn |
string | Optional: Additional text. It will be added as a marker. |
textTemplateId |
string | Required: Id of the mail template to use |
managerType |
string | Required: Type of the managers to notify. The available types are defined in the ManagerTypes enum in the atfcore-commonclasses project |
testOnly |
boolean | Optional: If true, only one mail will be generated and sent to the logged user (for testing purposes) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/notify-managers
Returns:
Return true if no errors were thrown during the execution
- Type
- boolean
(static) previewMailToShow(syllabusItemId, stageItemId, editionItemId, textTemplateId, signatureId, userId, takerId, token) → {MailPreview}
Generates the preview of a mail using the specified parameters
Parameters:
| Name | Type | Description |
|---|---|---|
syllabusItemId |
string | Required: Id of the syllabus's item (it will be included as a marker to resolve the mail parameters) |
stageItemId |
string | Required: Id of the stage's item (it will be included as a marker to resolve the mail parameters) |
editionItemId |
string | Optional: Id of edition's item (it will be included as a marker to resolve the mail parameters) |
textTemplateId |
string | Required: Id of the template to use |
signatureId |
string | Optional: Id of the signature to use |
userId |
string | Required (mutually exclusive with the takerId param): Id of the user to use as example source |
takerId |
string | Required (mutually exclusive with the userId param): Id of the taker to use as example source (the taker's allowed user will be retrieved) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/preview-mail-to-show
Returns:
Object with the parsed subject and body of the mail
- Type
- MailPreview
(static) previewMailToShowForSupplier(syllabusItemId, stageItemId, editionItemId, textTemplateId, signatureId, userId, takerId, token) → {MailPreview}
Generates the preview of a mail using the specified parameters
Parameters:
| Name | Type | Description |
|---|---|---|
syllabusItemId |
string | Required: Id of the syllabus's item (it will be included as a marker to resolve the mail parameters) |
stageItemId |
string | Required: Id of the stage's item (it will be included as a marker to resolve the mail parameters) |
editionItemId |
string | Optional: Id of edition's item (it will be included as a marker to resolve the mail parameters) |
textTemplateId |
string | Required: Id of the template to use |
signatureId |
string | Optional: Id of the signature to use |
userId |
string | Required (mutually exclusive with the takerId param): Id of the user to use as example source |
takerId |
string | Required (mutually exclusive with the userId param): Id of the taker to use as example source (the taker's allowed user will be retrieved) |
token |
string | Required: the Authorization Bearer token passed in the Header of the request |
Listens to Events:
- event:HTTP POST /rest-api/corporateacademy-mediator/preview-mail-to-show-for-supplier
Returns:
Object with the parsed subject and body of the mail
- Type
- MailPreview
(static) reenqueueInviteMail(token) → {MailQueue}
Re-enqueues the email of an invite
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/reenqueue-invite-mail/:mailQueueId
Returns:
The enqueued mail
- Type
- MailQueue
(static) reenqueueProposalRequestMail(token) → {MailQueue}
Re-enqueues the email of a proposal request
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/reenqueue-proposal-request-mail/:mailQueueId
Returns:
The enqueued mail
- Type
- MailQueue
(static) saveMailSender(mailSender, token) → {MailSender}
Creates or updates a new Mail sender
Parameters:
| Name | Type | Description |
|---|---|---|
mailSender |
MailSender | Required: The Mail sender object to persist |
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-mail-sender
Returns:
The newly created mailSender
- Type
- MailSender