Skip to main content

Why Courier Elemental?

Courier Elemental is the single format behind every Courier template: one multichannel wrapper that holds content of any type. A template is a JSON list of content blocks (text, image, action, and more), or a raw payload like an HTML document, and Courier renders it across every channel you send on: email, push, SMS, inbox, and chat. Define the notification once, and Elemental adapts it per channel, locale, and recipient. For email, you can build with Elemental blocks or drop in a complete HTML document. See Providing email content for how the two forms differ and when to use each.

Elemental Capabilities

Courier Elemental supports adaptive, multi-channel notifications. Here’s a quick overview of the main capabilities:

Localization

Automatically serve content in your users’ preferred language using Elemental’s built-in locale system. Define translations once and Courier handles the rest based on the recipient’s locale.
Learn more about localization in the Locales documentation.

Channel-Specific Customization

Customize your notification content for different channels using channel elements or the channels property. Send detailed emails and concise SMS from the same template structure. Using channel elements:
Using the channels property:
Learn more about channel customization in the Control Flow documentation.

Dynamic Logic

Use conditional rendering, loops, and element references to create notifications that adapt to your data and user context. Conditional rendering with if:
Iteration with loop:
Element references with ref:
Learn more about dynamic logic in the Control Flow documentation.

Where Elemental is Used

Elemental is the format everywhere content lives in Courier:
  • Stored templates: Templates are stored as Elemental. Edit them visually in Design Studio or Courier Create, or manage the same templates programmatically through the Templates API. The designer and the API read and write the same Elemental, so a template built in one is editable in the other. Design Studio wraps email content in a channel: email element.
  • Inline sends: Pass Elemental directly in a Send API request to send a one-off notification without storing a template.

Construct an Elemental Template

All Courier Elemental templates have the following top level structure. When used in API calls, this structure is passed as the content property of the message object:
In API calls, the Elemental template is nested under message.content:

Required Fields

string
required
Specifies the Elemental format version. The only supported value at this time is "2022-01-01"
CourierElement[]
required
Array of Courier Elements. See the Elements Index for a complete reference of all available element types.

Understanding Elemental Structure

Elemental templates use a tree-like structure where elements can contain other elements. The elements array is the root container, and many element types support nested elements arrays of their own.

Element Nesting

Elements can be nested within other elements to create complex, hierarchical structures: Container elements that support nesting:
  • group - Groups elements together for conditional logic or loops
  • channel - Contains channel-specific element collections
  • columns - Contains column elements, which in turn contain their own elements
  • list - Contains list-item elements, which can contain text content or nested lists
Example of nested structure:
In this example:
  1. The root elements array contains a channel element
  2. The channel element contains its own elements array with meta and group elements
  3. The group element contains a columns element
  4. The columns element contains column elements
  5. Each column contains its own elements array with image and text elements

Tree Structure Benefits

This hierarchical structure enables:
  • Logical grouping: Related elements can be grouped together
  • Conditional rendering: Entire groups can be shown or hidden based on conditions
  • Reusable patterns: Common element combinations can be encapsulated in groups
  • Channel customization: Different branches of the tree can target different channels
  • Complex layouts: Nested structures enable multi-column and grid layouts
For a complete reference of all available element types and their properties, see the Elements Index.

Example

A complete notification with a subject, banner image, body text, and a call to action: