Skip to main content

Personalize your emails using Brevo Template Language

Brevo Template Language allows you to dynamically personalize your email templates. Drop a contact attribute placeholder into your email to pull in contact-specific data and personalize a single email for multiple contacts. Go even further by inserting dynamic content into your emails to manage the display of content based on predefined conditions, all within the same email.

❓What is Brevo Template language?

Brevo Template Language allows you to insert placeholders into your email templates that are replaced by contact-specific data at the time the email is sent. More than just substitutions of text, our Template Language also supports conditions, loops, and filters.

🏷️ Placeholders

Placeholders (also called variables or merge tags) are tags that are added in your email templates and replaced with contact-specific data when the email is sent. This data can be the name, address, or even favorite color of your contact, the products they purchased, an unsubscription link, etc.

There are 3 types of placeholders in Brevo Template Language:

Contact attributes

The most commonly used placeholders are contact attributes placeholders, which allow you to dynamically include stored information about your recipients into your emails:

  • {{contact.FIRSTNAME}}
  • {{contact.EMAIL}}
  • {{contact.MANAGER}}

It can be their name, email address, or any custom contact attribute you've stored in your contact list.

dde_contact-attributes-placeholders_EN-US.png

➡️  Dedicated article: Customize your emails using contact attributes

💡 Good to know
Contact attributes placeholders appear as red tags in the Drag & Drop Editor.

Predefined placeholders

Predefined placeholders are available for all Brevo users, such as a mirror link, unsubscribe link, and update profile form link:

  • {{mirror}} ("View in browser" link)
  • {{unsubscribe}}
  • {{update_profile}}

These placeholders are usually automatically added to your templates when you create them. 

➡️  Dedicated articles:

Transactional parameters

Use transactional parameters placeholders to add data about your products or sales in your emails. It can be information about products purchased, products prices, products left behind in a cart, etc.

Transactional parameter placeholders are predefined if you are using a Brevo plugin or can be defined by you. You may then retrieve the data through an Automation workflow or through an API call to send a transactional email.

➡️  Dedicated article: Customize your emails using transactional parameters

🚰 Filters

Brevo uses filters together with placeholders to provide additional functionality to your emails. You can set up default values in case a contact attribute is empty, or structure the format of words, numbers, and dates.

➡️  Dedicated article: Modify the formatting of your placeholder with filters

👁️ Block visibility

The block visibility option allows you to easily choose how you want to display your blocks in your email templates.

dde_block-visibility_EN-US.png

For example, you can:

  • Personalize the heading of your email and use a different tone according to the age of your contacts.
  • Personalize content blocks to display different products or offers according to specific criteria (for example, a special discount for your loyal clients, according to their preferences etc.).
  • Personalize content blocks to suit different reading devices and display certain elements only on smartphones or desktop computers.

➡️  Dedicated articles:

🔁 Repeat block / Dynamic list (for tag)

Our Dynamic list option, now called Repeat block, enables you to loop or iterate over items in a sequence and display them as a list in your email. For example if you want to display a list of items that your contact has just bought or left in their carts.

This option is very powerful when combined with your transactional parameters and is also helpful when you are designing an email template to hold an unknown number of items in a list.

For an advanced use, you can manually repeat a block by using the for tag. For example below, a list of the product name followed by the product price for everything the client has purchased. This list will adapt according to the purchase of each client.

dde_repeat-block-example_EN-US.png

❗️ Important 
After adding your placeholders in your email, you must enable the Repeat block feature for each section that contains a placeholder for items data to ensure that your email template can display multiple products and interpret data sent by your website to Brevo.

➡️  Dedicated article: Repeat a block of items in your emails

🤯 Troubleshoot your emails customized with Brevo Template Language

Incorrect placeholder syntax

In the Drag & Drop Editor After an API call

After saving the design of your email template or campaign, an error message will appear if the syntax of one of your placeholders is not correct.

In our examples below, a bracket } is missing at the end of the placeholders. Take a look at the error details to correct the placeholder and save your email template or campaign again.

error-syntax_EN-US.png

Error log for a transactional email

If your API call receives a 200-level response but the email is not received, go to Transactional > Logs to check your Transactional Logs. If your email was not sent due to an error, an Error event will appear in your logs.

logs-error_EN-US.png

⏭️ 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.

💬 Was this article helpful?

12 out of 87 found this helpful