Template Blocks
Use template blocks to insert markup language into your notification.
Availability: Email only
Working With Template Blocks
The Template Block allows you to use Handlebars templates along with HTML and CSS to add customized content to your notifications.
The template block presents you with an HTML editor containing a div
and style
element. Starting with these elements, you can build out the look and feel of the block content.
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.
Using CSS With Handlebars
- In the notification designer, add a template block to an email notification.
- Open the
preview
tab and create a test event providing the data values for the template block.
- Select the test event in the preview to see the code rendered in the email.
Using Markdown in a Template Block
If you like to compose in markdown, you can do that using the template block. Just add a template block to your notification, add the following syntax:
Then write in your markdown between the {{#markdown}}
and close with {{/markdown}}
.
Using Replacement Variables in Handlebars
To insert a variable from your JSON event, you need the variable handlebars helper
Read More:
Inserting HTML Into a Handlebars Block
To pull in a data object variable containing HTML
, wrap the variable with triple curly brackets like: