STAGE:
LAUNCHED
🛠 APIs & SDKs 🎨 Notification Designer

Courier Elemental

STAGE: LAUNCHED

Courier Elemental brings the power of Courier's drag & drop cross-channel editor and puts it into the hands of developers to programmatically build messages that will intelligently render to the correct format for each channel. Paired with API V2, Courier Elemental even lets you use Courier without a single template at all!

Here are a few examples of Courier Elemental templates:

{
  "version": "2022-01-01",
  "elements": [
    {
      "type": "meta", // only the first matching `meta` element is used
      "title": "Welcome, {{first_name}}", // resolve Handlebars vars & fns
    },
    {
      "type": "text",
      "content": "Hello **world**",
      "format": "markdown" // optional; default is markdown
    }
  ]
}

Localized Text Element:

{
  "type": "text",
  "content": "hello",
  "locales": {
    "eu-fr": {
      "content": "bonjour"
    }
  }
}

Looped Elements:

{
  "version": "2022-01-01",
  "elements": [
    {
      "type": "text",
      "content": "* {{$.name}} listed at {{$.price}}",
      "loop": "data.products"
    }
  ]
}

Conditional References:

{
  "version": "2022-01-01",
  "elements": [
    {
      "type": "text",
      "content": "Threeeeeeee",
      "if": "data.some_field === 3",
      "ref": "el3" // name this element 'el3' for ref by other elements
    },
    {
      "type": "text",
      "content": "Hello **world**",
      "if": "refs.el3.visible"
    }
  ]
}

Channel-Filtered Elements:

{
  "version": "2022-01-01",
  "elements": [
    {
      "type": "meta",
      "title": "My Subject",
      "channels": ["email"] // this title only used for Email channel
    },
    { // ignored if another meta element already matched (i.e. email)
      "type": "meta",
      "title": "My Title"
    },
    {
      "type": "text",
      "content": "Hello **world**"
    }
  ]
}
Powered by LaunchNotes