Skip to main content

Create the service

Build a message

Attachments

Send a message

Send bulk messages

Send up to 50 messages in a single API call. Each message gets its own tracking ID.

Check delivery status

Common deliveryStatus values: delivered, delivered via secure portal, soft bounced, hard bounced, processing. Opens are reported separately in openedStatus, which the SDK sets to "unopened" until the message is opened.

Dynamic templates

Templates use Handlebars syntax ({{variable_name}}). Template content can be a string, Buffer, or readable Stream. In paubox-node 1.7.1 through 2.0.0, createDynamicTemplate, updateDynamicTemplate, and listDynamicTemplates expect older response shapes. When the API call succeeds, the promise rejects with the parsed response instead of resolving: the template object for create and update, and { templates: [...] } for list. The change is saved, so don’t retry a create that rejected this way. The samples below read the result from the rejection.

Create a template

List templates

Get a template

Update a template

Pass null for fields you want to leave unchanged:

Delete a template

Send a templated message

Scheduled send

Schedule a message for future delivery, check its status, reschedule, or cancel it.

Schedule a message

scheduledAt must be an ISO 8601 UTC datetime string in the future and within 30 days.

Get scheduled message status

Reschedule a message

Cancel a scheduled message

Error handling

All service methods return Promises and reject on API errors. Use try/catch in async functions: