Go SDK
Broadcast
Trigger broadcast notifications to list of subscribers in single call
Pre-requisites
Payload Schema
Broadcast body field description:
Parameter | Format | Description |
---|---|---|
list_id | string | list of users that you want to send broadcast messages. |
template | string | It is the template slug which can be found in Templates tab in SuprSend dashboard. |
notification_category | system / transactional / promotional | You can understand more about them in the Notification Category. |
channels (Optional) | string[] | 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) | XXdXXhXXmXXs or Number (in seconds) | 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) | date string in ISO 8601 | Trigger broadcast on a specific date-time. Example: “2021-08-27T20:14:51.643Z” |
data (Optional) | object | 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).