sendMail
Sends an email using a predefined template.
IMPORTANT!
Starting with v24.0, emails are sent asynchronously using job servers.
For v22.1.8 and prior, this function requires a valid SMTP server configured in the web service.
Starting with v24.0, emails are sent asynchronously using job servers.
For v22.1.8 and prior, this function requires a valid SMTP server configured in the web service.
Syntax
Copy
function sendMail(templateName: string, to: string[], tokens: any, attachments: any, cc: string[]): void
Parameter | Description |
---|---|
templateName
|
Name of a predefined email template to be used. |
to
|
Recipient's email address. |
tokens
|
Keys for substitution. They are defined as properties of an object and replaced with their values. Tokens are enclosed in brackets in the email template body (e.g., {accountName}). |
attachments
|
The files to be attached to the email. This is a JSON object with its key-value pairs representing:
|
cc
|
Array of strings containing the Carbon Copy email recipients. |