Prerequisites
- A Courier account with at least one configured email provider (e.g. SendGrid)
- Your Courier API key (found in Settings > API Keys)
Send a Simple Elemental Message
The fastest way to use Elemental is the sugar syntax: justtitle and body. Courier automatically converts this into the full Elemental format behind the scenes.
1
Send with title and body
2
Verify delivery
Check the Message Logs in the Courier dashboard to confirm the message was delivered and see the rendered output.
The sugar syntax is ideal for simple messages. For multi-element layouts, channel-specific content, or dynamic logic, use the full Elemental format below.
Use Full Elemental Format
Full Elemental gives you complete control over the notification structure. Every template requires aversion field ("2022-01-01") and an elements array.
1
Build a structured notification
This example creates an order confirmation with a heading, body text, and a call-to-action button.
Element Types at a Glance
For full property details, see the Elements Reference.
Customize Content Per Channel
Usechannel elements to send different content to different channels from a single API call. This is one of Elemental’s most powerful features.
channels property on individual elements to show or hide them by channel without wrapping in a channel block:
Add Conditional Logic
Use theif property on any element to conditionally render it based on your data.
if expression is evaluated as JavaScript against the data object you pass in the send call.
Render Dynamic Lists
Theloop property iterates over an array in your data and renders the element once per item.
{{$.item}} refers to the current item and {{$.index}} gives the zero-based index.
The
format property on text elements supports "markdown" for bold, italic, and link rendering. Use double asterisks (**bold**) or single asterisks (*italic*) in your content strings.