Loading...
Skip to main content

Courier Elemental

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

FieldTypeRequiredDescription
versionstringrequired
elementsCourierElement[]requiredArray 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",
}
}
}