Learn how to trigger workflows using any of the available methods.
workflows.trigger
endpoint or via event trigger. In SuprSend, we refer events as user-initiated actions, such as social media interactions, or system-generated events like pending payments. User needs to be created beforehand for event based triggers.
Direct API trigger is a straightforward way to get started, as you can include recipient channel information directly in the API call and doesn’t require prior user creation to initiate the notification.
"$skip_create": true
flag.This can be applied inside the actor, individual user recipient objects, or object recipient objects.Property | Type | Description |
---|---|---|
workflow | string | Slug of designed workflow on SuprSend dashboard. You’ll get the slug from workflow settings. |
actor (optional) | string / object | Includes distinct_id and properties of the user who performed the action. You can use it for cross-user notifications where you need to include actor properties in notification template. Actor properties can be added as $actor.<prop> . |
recipients | array of string / array of objects | List of users who need to be notified. You can add up to 100 recipients in a workflow trigger. You can either pass recipients as an array of distinct_id (if user is pre-synced in SuprSend database) or define recipient information inline. To notify object, pass object_id and type in recipient JSON. |
data | object | variable data required to render dynamic template content or workflow properties such as dynamic delay or channel override in send node. |
tenant_id | string | unique identifier of the brand / tenant |
idempotency_key | string | unique identifier of the request. We’ll be returning idempotency_key in our outbound webhook response. You can use it to map notification statuses and replies in your system. |
recipients[].$timezone | string | to set recipient’s timezone. Used to send notification in user’s local timezone. You can pass timezone in IANA (TZ identifier) format. |
recipients[].$preferred_language | string | to set recipient’s preferred language. This is to support localization in notification content. You can pass the language in ISO 639-1 2-letter format. Refer all language codes here. |
$skip_create | boolean | Optional flag that can be used inside actor , or recipient payloads including both user , or object . When set to true , SuprSend will not create the user or object if it doesn’t already exist in the system. |
$recipient.<property>
.
This is how the complete recipient payload with look like
Property | Type | Description |
---|---|---|
distinct_id | string | Unique identifier of the user to be notified. |
communication channels (sms, etc). | array of string | You can pass user channel information using $<channel> key. This will override existing channel value from the user profile and use the channel value defined in the key for notification trigger. The same channel information will also be appended to user profile in the background Refer how different communication channels can be passed here |
$channels | array of string / dicts | Use it to pass user’s channel preference in the payload. You can always use our in-build preference APIs to maintain user notification preferences. Preferences defined within SuprSend will automatically apply with workflow trigger. By default, notifications will be sent to all channels defined in the workflow delivery node. However, if you have a scenario where user has specific channel preference for a notification (e.g. they only want to receive payment reminders via email), you can include that preference in the workflow payload. This will ensure that notifications are sent only to the channels specified in the $channels key. The supported channel values are email, sms, whatsapp, androidpush, iospush, slack, webpush, ms_teams . |
$preferred_language | string | to set recipient’s preferred language. This is to support localization in notification content. You can pass the language in ISO 639-1 2-letter format. Refer all language codes here . |
$timezone | string | to set recipient’s timezone. Used to send notification in user’s local timezone. You can pass timezone in IANA (TZ identifier) format. |
* | key-value pair | You can pass other user properties to render dynamic template content in key-value pair as "user_prop1":"value1" . Extra properties will be set in subscriber profile (as subscriber properties) which can then be used in the template as $recipient.<property> . |
distinct_ids
or recipient objects. You can pass up to 100 recipients in a single workflow trigger. SuprSend will internally convert it into multiple workflow triggers, one for each recipient in the array.
$actor.<property>
.
Sample template with actor and recipient properties:
distinct_id
passed in your event call. If user is not present, it will discard the event call.Object triggers are not currently supported in event. Please get in touch if you have this requirement.Create a template group on SuprSend account.
{{...}}
will be passed from the Google Sheet at the time of trigger.Create a google sheet with following data.
distinct_id
column- this is the unique identifier of the user who needs to be notified.
Hi {{name}}, your {{Event}} is scheduled at {{Schedule}}. See you there.
, you’ll have to create a column for each template variable -name
, Event
, and schedule
in your sheet.
WA
for whatsapp, Email
for email and SMS
for SMS. +917123xxxxxx
.
SuprSend Status
column- Fill the value TBT
in rows for which you want to trigger the notification. Once, the notification is triggered, the status changes to OK
.+
**. To enter in + format, use string function: ="+917123xxxxxx"
Go top the Google Sheets Navbar
Extensions
and select Apps Script
Remove the default information in the Apps Script
Data | Description |
---|---|
api-key | API Key for your workspace. From left navigation panel, select settings -> API Keys. |
api-secret | API Key for your workspace. From left navigation panel, select settings -> API Keys. |
template-slug | Add the template slug of the template that you want to trigger. You can copy the the template slug by clicking on copy icon next to the template name on template details page. |
Workflow Name | Give a name to identify your workflow. It’ll help you locate the sent workflow on the workflow listing page. You can see the notification performance on Workflow -> Analytics page. |
category | Provide notification category. We recommend using promotional sub-category for sending engagement notifications. You can read more Notification Categories here. |
Save the Script - Close the Tab - Reload your Google Sheets Page!
OK
.
Check the Status
Logs
page.