Notification

Notification

Send Notifications

Kind: global class

new Notification(templateUid)

Create a new instance of the Notification class.

ParamTypeDescription
templateUidstringThe uid of the notification template to use, must be an existing record in the notfication_template_container table.

notification.send()

Send a notification based on the template uid, to the recipients

Kind: instance method of Notification
Example

const notification = new Notification("template_uid");
notification
     .setContext(context)
     .setRecipients(recipients)
     .send();

notification.context ⇒ Object

Get the context currently set

Kind: instance property of Notification

notification.recipients ⇒ Array

Get the recipients currently set

Kind: instance property of Notification

notification.templateUid ⇒ String

Get the templateUid currently set

Kind: instance property of Notification

notification.setContext(context) ⇒ this

Set the context to be used when parsing the template

Kind: instance method of Notification
Returns: this - Returns the instance of the class, providing the ability to chain methods.

ParamType
contextObject

notification.setRecipients(recipients) ⇒ this

Set an array of users to receive the communication.

Kind: instance method of Notification
Returns: this - Returns the instance of the class, providing the ability to chain methods.

ParamType
recipientsArray

notification.setTemplate(uid) ⇒ this

Set the template to use in the desired communication.

Kind: instance method of Notification
Returns: this - Returns the instance of the class, providing the ability to chain methods.

ParamType
uidString