Notification
Send tenant workflow emails through a mailbox and template
The Notification module is the email action used by workflows. It sends one event email to explicit recipients using a selected tenant mailbox and email template.
Use Campaigns for newsletters, broadcasts, profile-list sends, and outreach sequences.
Trigger Notification
/v1/notifications/trigger sdk.notification.trigger() await sdk.notification.trigger({
channel: 'email',
store_id: 'store_123',
email_template_id: 'tmpl_order_confirmation',
mailbox_id: 'mailbox_123',
recipients: ['customer@example.com'],
vars: {
order: { number: '1001' },
store: { name: 'My Store' },
},
});Parameters
| Name | Type | Description |
|---|---|---|
channel required | string | Notification channel. Currently only 'email'. |
store_id required | string | Store ID |
email_template_id required | string | Workflow-capable email template ID |
mailbox_id required | string | Tenant mailbox used as the delivery sender |
recipients required | string[] | Explicit recipient email addresses |
vars optional | Record<string, any> | Handlebars variables passed to the email template |
Notification trigger does not accept profile_list_id. To email a profile list, create a campaign and select that profile list as the audience source.
How Notifications Work
Default workflows can call this endpoint for tenant event emails:
- Order created -> sends order confirmation to the profile and notification to the store
- Service scheduled through an order -> uses the order workflow data
- Form submitted -> sends the contact submission to the store
- Profile list confirmation -> sends the double opt-in confirmation to the subscriber
Tenant workflow emails require a mailbox. New stores may seed these workflows as drafts until a mailbox is selected.
Template Variables
Variables are passed as vars and rendered with Handlebars in the template subject, preheader, and HTML body.
await sdk.notification.trigger({
channel: 'email',
store_id: 'store_123',
email_template_id: 'tmpl_custom',
mailbox_id: 'mailbox_123',
recipients: ['user@example.com'],
vars: {
name: 'Jane',
code: 'ABC123',
},
});
See Email Templates for creating reusable templates and Campaigns for audience sends.