Skip to main content

Template Language

Briskine uses the Handlebars templating language to support personalized and dynamic content in templates.

You can use all of the built-in features of Handlebars, in Briskine templates.

Syntax

Handlebars uses curly braces for wrapping expressions. The simplest Handlebars expression is what we call a variable in Briskine.

{{to.first_name}}

When you insert a template, Briskine will automatically replace the expression/variable with a different value.

Expressions can also be helpers or block helpers (e.g., for inserting dates or conditional statements).

Escaping expressions

Because curly braces have a special meaning, Briskine tries to replace anything wrapped in {{ }} with a variable or a helper.

If the expression looks like a helper call, but Briskine has no helper with that name, you'll see an error instead of your template:

Template
Preview
Missing helper: "Invoice"

To write curly braces as regular text, add a backslash (\) in front of the opening braces. Briskine will insert the text as you wrote it, without the backslash:

Template
Preview
Your invoice number is {{Invoice number}}.

Expressions without an error

You won't always see an error. When an expression is a single word, like {{Invoice}}, Briskine first looks for a helper with that name, and then for a variable. If it finds neither, the expression is replaced with nothing at all:

Template
Preview
Your invoice number is .

Escaping works the same way here. Add a backslash in front of the opening braces to keep the text as you wrote it:

Template
Preview
Your invoice number is {{Invoice}}.
info

You'll find examples for the most used Handlebars features in the Briskine Help Center.

For information about Handlebars internals or advanced features, see the Handlebars documentation.