message object with four core fields: to (recipient), content or template (what to send), routing (which channels), and data (personalization variables). For a conceptual overview of how these work together, see How Sending Works.
Sending Messages with Templates
Templates are an easy way to create, update, and manage notification content in Courier without changing your code. Thetemplate parameter accepts either a template ID or a template alias. Template IDs are permanent unique identifiers, while aliases are human-readable names you can give a template (eg welcome-email).
Sending to Users
Send to a Courier User by specifying theiruser_id in the to field. Courier automatically looks up the user’s stored identifiers (email, phone, push tokens, chat handles) and applies your routing rules to deliver the message through the best available channels.
Use profile variables from the user object in your templates or channel conditions to personalize message content and control which channels are used.
Sending to Multiple Channels
You can send a single message across multiple channels using routing rules. In this example, Courier will try each channel in order until the message is successfully delivered.single— Try channels in the listed order until one succeeds. This is the default and provides priority-based fallback delivery (for example, try push first, then email, then SMS).all— Send through every listed channel at once so users receive the message everywhere they’re active.
single, the order of channels in the array determines priority. Courier attempts the first channel, and if delivery fails or the user lacks contact info for that channel, it moves to the next one.
What Channels does Courier Support?
Courier supports sending through multiple channel types. Each channel can connect to one or more providers that you configure in your workspace.email— SendGrid, Mailgun, AWS SES, and moresms— Twilio, MessageBird, Plivo, and morepush— Firebase FCM, Apple Push, and morechat— Slack, Microsoft Teams, and moreinbox— Courier Inbox for in-app notifications for web and mobile
Sending to Multiple Users
Send the same message to multiple recipients in a single API call by using an array in theto field:
data object applies to all recipients. For user-specific personalization, ensure your template uses profile-based variables ({{profile.variable}}).