Notification
Notification
Send Notifications
Kind: global class
- Notification
- new Notification(templateUid)
- .send()
- .context ⇒
Object
- .recipients ⇒
Array
- .templateUid ⇒
String
- .setContext(context) ⇒
this
- .setRecipients(recipients) ⇒
this
- .setTemplate(uid) ⇒
this
new Notification(templateUid)
Create a new instance of the Notification class.
Param | Type | Description |
---|---|---|
templateUid | string | The 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.
Param | Type |
---|---|
context | Object |
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.
Param | Type |
---|---|
recipients | Array |
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.
Param | Type |
---|---|
uid | String |