Snippets are common blocks of HTML or text that can be used globally across all templates. Some clever uses included:

  • Reusing Common headers and footers across templates
  • Reusing Common CSS
  • Keeping a “library” of jinja macros to be reused throughout templates

Snippets can be found under the Content section on the sidebar.

How do I use snippets?

Snippet syntax is easy! Simply reference the snippet name in the template:

Email Snippet Example

And in your template:

{% snippet "A Snippet" %}

Can I use snippets in snippets?

Yes! Snippets in snippets are supported.

Can snippets be given variables like a function?

Snippets don’t take variables. It’s better to use a jinja macro to accomplish that.

Can variables be used in snippets?

Yes! All data that can be referenced in a template can be referenced in a snippet.