Send beautiful HTML emails
Kind: global class
- Email
- new Email(templateUid)
- .send()
- .context ⇒
Object
- .recipients ⇒
Array
- .templateUid ⇒
String
- .setContext(context) ⇒
this
- .setRecipients(recipients) ⇒
this
- .setTemplate(uid) ⇒
this
new Email(templateUid)
Create a new instance of the Email class.
Param | Type | Description |
---|---|---|
templateUid | string | The uid of the email template to use, must be an existing record in the email_template_container table. |
email.send()
Send the email based on templateUid
, to the recipients
,
Kind: instance method of Email
Example
const email = new Email("template_uid");
email
.setContext(context)
.setRecipients(recipients)
.send();
email.context ⇒ Object
Get the context currently set
Kind: instance property of Email
email.recipients ⇒ Array
Get the recipients currently set
Kind: instance property of Email
email.templateUid ⇒ String
Get the templateUid currently set
Kind: instance property of Email
email.setContext(context) ⇒ this
Set the context to be used when parsing the template
Kind: instance method of Email
Returns: this
- Returns the instance of the class, providing the ability to chain methods.
Param | Type |
---|---|
context | Object |
email.setRecipients(recipients) ⇒ this
Set an array of users to receive the communication.
Kind: instance method of Email
Returns: this
- Returns the instance of the class, providing the ability to chain methods.
Param | Type |
---|---|
recipients | Array |
email.setTemplate(uid) ⇒ this
Set the template to use in the desired communication.
Kind: instance method of Email
Returns: this
- Returns the instance of the class, providing the ability to chain methods.
Param | Type |
---|---|
uid | String |