Using Twig
In the article
Twig overviewPersonalizing email with TwigReceiptsMultiple languagesNewsletterAdvertisementTwig overview
Twig syntax provides a simple, powerful way to
include dynamic content, directly within email templates. Twig syntax allows all of
this dynamic templating to occur outside of code, meaning changes are done quickly in the
template, with no update to a code base required.
include dynamic content, directly within email templates. Twig syntax allows all of
this dynamic templating to occur outside of code, meaning changes are done quickly in the
template, with no update to a code base required.
Personalizing email with Twig
We support the use of Twig in our emails. This page will describe how to use the following
helpers:
This page has use cases with examples that include the described helpers.
Receipts
This is an example
receipt template.
This receipt template is using these helpers:
Multiple languages
This is an example
template that lets you have content in multiple languages.
This template is using this helper:
- Conditional statements –
if/else
Newsletter
This is an example
newsletter template.
This template is using these helpers:
Advertisement
This is an example
template that is advertising items on sale.
This template is using these helpers:
- Substitution
- Conditional statements –
if/else
- Iterations
{"firstName":"Ben"}
Test Data should contain:
Shipping to @{{shippingAddress.country}}