Template Blocks
Use template blocks to insert HTML and Handlebars into your notification.
Template Blocks allow you to leverage HTML, CSS, and Handlebars templating for highly customized email notifications in Courier. Template Blocks provide a powerful way to create dynamic, richly formatted content for your email notifications. They combine the flexibility of HTML and CSS with the dynamic capabilities of Handlebars templating.
Plain Text
Plain text preview is not supported for template blocks at this time. Anything created with template blocks will not render as plain text in emails.
Template Block Boilerplate
Email Client Support
HTML and CSS support varies by email client.
Handlebars Templating Language
The Template Block supports Handlebars. You can learn about the language syntax from the Handlebars Language Guide.
Read more: Custom Courier Handlebars helpers.
Styling with CSS and Handlebars
Combine CSS and Handlebars for dynamic styling:
Template Block with CSS and Handlebars
Using Markdown in a Template Block
Render markdown between {{#markdown}}
and {{/markdown}}
within a template block.
Using Replacement Variables in Handlebars
Insert variables from your JSON event data:
Read More:
Inserting HTML from Variables
To render HTML stored in a variable, use triple curly braces: