Node.js SDK
Broadcast
Trigger broadcast notifications to list of subscribers in single call
Pre-requisites
Trigger Broadcast
You can trigger broadcast using supr_client.subscriber_lists.broadcast()
method.
Parameter | Description |
---|---|
list_id | list of users that you want to send broadcast messages. |
template | It is the template slug which can be found in Templates tab in SuprSend dashboard. |
notification_category | Preference Category to apply user preference settings while sending. Root categories - system / transactional / promotional |
channels (Optional) | User channels on which the broadcast messages to be sent. If not provided, it will trigger notifications on all available channels in user profile. Available channels: androidpush / iospush / inbox / email / whatsapp / sms Example:[“sms”, “inbox”] |
delay (Optional) | Broadcast will be halted for the time mentioned in delay, and become active once the delay period is over. Example: 1d2h3m4s / 60 |
trigger_at (Optional) | Trigger broadcast on a specific date-time. Example: “2021-08-27T20:14:51.643Z” |
data (Optional) | variable data defined in templates |
Add file attachment (for email)
To add one or more attachments to a notification (viz. Email), call add_attachment()
on broadcast instance for each attachment file. Ensure that attachment url is valid and public, otherwise error will be raised. Since broadcast instance size can’t be > 100 KB, local file paths can’t be passed in event attachment.
🚧 A single broadcast instance size (including attachment) must not exceed 100KB (100 x 1024 bytes).