Email

Email

Send beautiful HTML emails

Kind: global class

new Email(templateUid)

Create a new instance of the Email class.

ParamTypeDescription
templateUidstringThe 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.

ParamType
contextObject

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.

ParamType
recipientsArray

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.

ParamType
uidString