Dynamically customize transactional email templates

❗️ Important
If you are editing a template created using the old template language (typically before September 21, 2018), please refer to this article or enable the New Template Language to use the functionalities of this article.

In this article, we will provide an overview of how to dynamically customize email templates used in the Transactional and Automation platforms.

You may use the Sendinblue Transactional (SMTP) platform to create and send your transactional emails, which are sent as a result of a contact's request or action (e.g. purchase confirmations, password resets, notifications, etc.). Keep in mind that emails sent as part of an Automation workflow are also delivered via our Transactional platform.

Before you start

💡 Good to know
When sending a transactional email via the API, we recommend including the email template HTML within the API call rather than saving the email template in Sendinblue.

Customize transactional email templates

You can customize email templates in several ways, all of which are powered by Sendinblue's New Template Language.

Add placeholders for recipient-specific content

These content placeholders are called variables. Sendinblue enables you to include three types of variables in your email templates:

Apply conditional logic to your template

You may control if and how content within your template is visible to recipients. This logic is established by applying tags around or within your content blocks. 

The if tag

The if tag enables you to test if an expression is true and modify the email content based on the result. For example, "If the contact's attribute for favorite color is blue", then show the content.

You can also manage more complex if statements that check for false values, multiple conditions, or multiple decision branches.

Using if, you may add or remove entire content blocks within a template or modify content within a block. For example, if your contact’s attribute for gender is male, you may wish to insert an image of men’s clothing.

The for tag

The for tag enables you to “loop” or iterate over items in a sequence and display them as a list in your email. This is very powerful when combined with your transactional parameters, and is also helpful when you are designing a template to hold an unknown number of items in a list.

Using for easily enables complex tasks, such as inserting a dynamic list of products into your template.

💡 Good to know
You can use the if and for tags very simply and easily without any coding by using the Drag & Drop Editor's display conditions tool. Learn more about using the if tag and using the for tag.

Modify variables within your template using filters

You may change how a variable’s content is formatted in your template by applying filters:

⏩ What's next?

🤔 Have a question?

If you have a question, feel free to contact our support team by creating a ticket from your account. If you don't have an account yet, you can contact us here.