Introduction
Courier Elemental is a powerful JSON based syntax for describing the content of your notification in a way that will work for email, push, chat, or any channel you use to notify users. With Courier Elemental you can customize the look, language, and structure of your notification based on locale, channel, and other more advanced custom logic.
Construct an Elemental Template
All Courier Elemental templates have the following top level structure:
{
"version": "2022-01-01",
"elements": CourierElement[]
}
Fields
Field | Type | Required | Description |
---|---|---|---|
version | string | required | |
elements | CourierElement[] | required | Array of Courier Elements |
Usage
Courier Elemental can be used in place of a standard template in a /send
call. To do so,
pass the elemental document as the content
property of the message object:
{
"message": {
"to": { /** etc */ },
"content":{
"elements": [
{
"type": "meta",
"title": "My Title"
},
{
"type": "text",
"content": "Hello **world**"
}
],
"version": "2022-01-01",
}
}
}
Export to elemental
Export to elemental is currently in beta. Reach out to support@courier.com if you need access.
If you have to port existing notification templates built inside Courier or use notifications drag-and-drop builder you can still do that and export the template to Elemental syntax. Go to the template, click the dropdown next to Publish button on top right and hit "Export to Elemental".