Brevo offers two methods to personalize your messages: inserting a variable directly using the Add variable option in the toolbar, or typing it manually.
This article covers the manual method. If you prefer the Add variable method, check our dedicated article Personalize your messages with dynamic content (Brevo Template Language).
Use the Brevo Template Language to personalize your messages with contact or event-specific data, hide or display content to specific recipients, and adjust how values are formatted in your messages.
💬 Variables
Variables, also known as placeholders or merge tags, are tags that you can insert into your messages to personalize them. When you send a message, each variable is automatically replaced with the corresponding contact’s information.
In Brevo's template language, variables must be enclosed within double curly brackets, like {{ ... }} or {{...}}. They can be used for simple insertions or combined with conditional statements and filters for advanced personalization.
The Brevo Template Language supports different types of variables:
👤 Contact variables
| Available for: | ✅ SMS | ✅ Push |
Contact variables allow you to display data from your contacts' attributes, such as a contact's first name, in your messages. These variables are formatted as {{ contact.ATTRIBUTE }}, where you should replace ATTRIBUTE with the exact name of your contact attribute as it appears on the Contact attributes page in your Brevo account. You can use both default Brevo attributes and custom attributes.
Here are some examples of contact variables with three default Brevo attributes and one custom attribute:
| Input | Description | Output |
|---|---|---|
{{ contact.EMAIL }} |
Displays the email address of the recipient (default). | abby@the-green-yoga.com |
{{ contact.FIRSTNAME }} |
Displays the first name of the recipient (default). | Abby |
{{ contact.SMS }} |
Displays the phone number of the recipient (default). | +12152688872 |
{{ contact.LANGUAGE }} |
Displays the language of the recipient (custom). | English |
➡️ To learn more about the different types of contact attributes available and how to create custom ones, check our dedicated articles:
🔗 Email link and preview variables
| Available for: | ✖️ SMS | ✖️ Push |
Email link and preview variables allow recipients to view your email in their browser, unsubscribe from your communications, and manage their preferences. These variables should be placed inside an HTML <a> tag, wrapping the text that will be displayed in the email.
The following email link and preview variables are available:
| Input | Description | Output |
|---|---|---|
|
<a href=" |
Displays the mirror link with the text "View in browser". |
View in browser |
|
If you'd no longer <a href=" |
Displays the unsubscribe link with the text "Unsubscribe". | Unsubscribe |
|
<a href=" |
Displays the update profile link with the text "Update your preferences". | Update your preferences |
|
<a href=" |
Displays the double opt-in link with the text "I confirm my subscription". | I confirm my subscription |
➡️ To learn more, check our dedicated articles:
- Insert a 'View in browser' link in your campaigns
- Insert an unsubscribe link in your campaigns
- Update your contacts details and preferences (profile update form)
- Create a custom double opt-in (DOI) email template for a sign-up form created in Brevo
📅 Date variables
| Available for: | ✅ SMS | ✖️ Push |
Date variables allow you to insert a timestamp of the exact date and time an email was sent. The date is based on your Brevo account's timezone. If no timezone is set in your account, the variable will default to the current timestamp in UTC.
The following date variable is available:
| Input | Description | Output |
|---|---|---|
Today is {{ time_now }}
|
Displays the exact date and time an email was sent with the following timestamp format: |
Today is 2025-03-11 15:10:20.823713502 +0100 CET |
Today is {{ time_now |date:"Monday, Jan 2, 2006" }}
|
Displays the exact date and time an email was sent with the format specified in the date filter. |
Today is Tuesday, Mar 11, 2025 |
➡️ To learn more about adjusting the formatting of dates, check our dedicated article Modify the formatting of your placeholders with filters.
⚡ Event variables
| Available for: | ✅ Email (triggered only) |
✅ SMS (triggered only) |
✅ WhatsApp (triggered only) |
✖️ Push |
Event variables allow you to display data from specific events triggered by a contact's actions, such as the price of their last purchased item or the name of the meeting they booked.
To identify event variables for your message, check your API call or event logs in Brevo. Here's an example of a typical JSON structure, where:
|
|
The root object data is mandatory. All other properties are optional and can be named as needed.
Event variables are formatted using double curly brackets. Each data in the JSON structure can be included in an event variable to personalize your messages:
Data stored directly under the root object of the JSON structure typically contain key event details, such as cart information. These values can be retrieved using an event variable, without needing to loop through arrays, using the following syntax:
{{ params.property }}
Where:
-
paramsrefers to the root object. Always useparamsto refer to the root object, even if it's named differently in your JSON structure. -
propertyshould be replaced by the exact name of the property under the root object in your JSON structure.
For example, in our JSON structure, the root object is called data, and it contains the properties id, total, currency, and url. Therefore, the corresponding event variables would be:
| Input | Description | Output |
|---|---|---|
|
|
Cart ID | cart:1234 |
|
|
Cart total | 280 |
|
|
Cart currency | USD |
|
|
Cart URL | https://www.example.com |
Arrays stored under the root object, such as the items array in our JSON example, can contain multiple elements, and each element may have various properties.
You can either display specific elements using indexing or all the elements using a for loop.
Display specific elements using indexing
If you only need to access certain elements in an array, without displaying the entire array, you can manually reference each element by its position (index). Arrays are ordered, meaning each element has a specific position, starting from index 0 for the first element, 1 for the second, and so on.
To reference specific elements, the event variables are formatted as {{ params.array.index.property }}, where:
-
paramsrefers to the root object. Always useparamsto refer to the root object, even if it's named differently in your JSON structure. -
arrayshould be replaced by the exact name of the array under the root object, as it appears in your JSON structure. -
indexshould be replaced with the index number of the element you want to reference. -
propertyshould be replaced by the exact name of the property within the array element, as it appears in your JSON structure.
For example, in our JSON structure, the first item (index 0) is "Black shoes" and the second item (index 1) is "White shirt". Therefore, the corresponding event variables would be:
| Input | Description | Output |
|---|---|---|
|
|
Name of the first item in the array | Black shoes |
|
|
Name of the second item in the array | White shirt |
Display all the elements using a for loop
Use a for loop to display all elements in an array dynamically. Instead of manually referencing each index, the loop iterates through the array and displays each item automatically. This is especially useful when the number of items in the array is unknown, such as a list of weekly blog posts or a receipt for purchased products.
For example, in our JSON structure, if we want to show the name of every item in the items array, the corresponding for loop would be:
| Input | Description | Output |
|---|---|---|
{% for item in
|
Name of all the items in the array |
Black shoes White shirt |
➡️ To learn more about for loops, check our dedicated article [Manual] Repeat a block of items in your emails using for loops.
🛢️ Data feed variables
| Available for: | ✅ SMS | ✖️ Push |
Data feed variables allow you to personalize your marketing communications sent with Brevo with the latest information about products, customers, events, or any other relevant data from your external data source or API. Use them to automate and personalize your messages with real-time data.
To identify data feed variables for your message, click the account dropdown and select Settings > Data management > Data feeds to check your source file structure on Brevo:
Data feed variables are formatted using double curly brackets. Depending on the complexity of your data feed structure, the format of your data feed variables varies:
Data stored directly under the root object of the JSON structure typically contain the most relevant, immediate, or ongoing entity. These values can be retrieved without needing to loop through arrays using the following syntax:
{{feed.feedalias.variable}}
You should then replace:
-
feedaliaswith the exact alias name of your data feed, matching the spelling and case as it appears on the Data feeds page. -
variablewith the specific variable or field name you want to display, e.g., name, price, date.
For example, in our JSON structure, the root object is called next_yoga_class, and it contains the properties class_name, studio_location, date, time, level, duration, room, and instructor. Therefore, the corresponding event variables would be:
| Input | Description | Output |
|---|---|---|
{{feed.next_yoga_class.class_name}} |
Yoga class name | Sunrise Vinyasa |
{{feed.next_yoga_class.studio_location}} |
Location of the yoga studio | Downtown Studio |
{{feed.next_yoga_class.date}} |
Date of the yoga class | 2025-03-07 |
{{feed.next_yoga_class.time}} |
Time of the yoga class | 06:30 AM |
Arrays stored under the root object, such as the following_classes array in our example, can contain multiple elements, and each element may have various properties.
You can either display specific elements using indexing, or all the elements using a for loop. The syntax to retrieve a complex data feed is:
{{ feed.feedalias.array.index.variable }}
You should then replace:
-
feedaliaswith the exact alias name of your data feed, matching the spelling and case as it appears on the Data feeds page. -
arraywith the array that contains the values for each item. -
indexwith the position of the specific item you want to display from your data feed (starting from 0 for the first item). -
variablewith the specific variable or field name you want to display, e.g., name, price, date.
For example, in our JSON structure, the first item (index 0) is "Power Flow Yoga" and the second item (index 1) is "Evening Restorative". Therefore, the corresponding data feed variables would be:
| Input | Description | Output |
|---|---|---|
|
|
Name of the first item in the array | Power Flow Yoga |
|
|
Name of the second item in the array | Evening Restorative |
Display all the elements using a for loop
Use a for loop to dynamically display all elements in an array. Instead of manually referencing each index, the loop iterates through the array and displays each item automatically. This is especially useful when the number of items in the array is unknown, such as a list of weekly blog posts or a receipt for purchased products.
For example, in our JSON structure, if we want to show the name of every item in the following_classes array, the corresponding for loop would be:
| Input | Description | Output |
|---|---|---|
{% for item in feed.
|
Name of all the items in the array |
Power Flow Yoga Evening Restorative Hatha Yoga Basics Yin Yoga & Meditation ... |
🛒 Product feed variables
| Available for: | ✅ SMS | ✖️ Push |
Product feed variables allow you to display a dynamic list of products from your online store, facilitating the creation of personalized recommendations. It contains product details like name, description, prices, images, and availability. Use it to showcase popular items, personalize recommendations, or maintain consistent product displays in your marketing campaigns.
Product feed variables are formatted using double curly brackets:
{{ feed.feedalias.products.variable }}
You should then replace:
-
feedaliasis the exact name of your product feed, matching the spelling and case as it appears on the Product feeds page. -
variableis the field's name in the API that contains the data you want to retrieve?.
| Input | Description | Output |
|---|---|---|
{{feed.mats_bestseller.products.imageUrl}} |
Product image | |
{{feed.mats_bestseller.products.name}} |
Product name | Non-slip yoga mat - 6mm |
{{feed.mats_bestseller.products.url}} |
Link to the product | https://thegreenyoga.com/non-slip/black-mat.html |
Display all the elements using a for loop
Use a for loop to dynamically display all elements in an array. Instead of manually referencing each index, the loop iterates through the array and displays each item automatically. This is especially useful when the number of items in the array is unknown, such as a list of weekly blog posts or a receipt for purchased products.
For example, if we want to show the name of every item in the mats_bestseller product feed, the corresponding for loop would be:
| Input | Description | Output |
|---|---|---|
{% for item in feed.
|
Name of all the items in the product feed |
Non-slip yoga mat - 6mm Yoga block - 4inch High waist wide leg yoga pants |
➡️ To learn more about for loops, check our dedicated article [Manual] Repeat a block of items in your emails using for loops.
📢 Conditional statements
| Available for: | ✖️ SMS | ✖️ Push |
👀 Conditional display (if statements)
Use an if statement to show or hide parts of your email based on each recipient’s data. This allows you to send a single email that dynamically adapts to different contacts, depending on specific conditions.
➡️ To learn more about if statement, check our dedicated article [Manual] Show or hide content in your emails using if statements.
🔁 Repeatable sections (for loops)
Use a for loop to dynamically display all elements in an array. Instead of manually referencing each index, the loop iterates through the array and displays each item automatically. This is especially useful when the number of items in the array is unknown, such as a list of weekly blog posts or a receipt for purchased products.
➡️ To learn more about for loops, check our dedicated article [Manual] Repeat a block of items in your emails using for loops.
🪄 Filters
| Available for: | ✅ SMS | ✖️ Push |
Filters modify the output of a variable by transforming its value. They are placed inside the variable's double brackets and separated by a pipe |, e.g., {{ contact.FIRSTNAME|upper }}. You can also chain multiple filters together, with each filter applying its transformation to the result of the previous one.
Here are some examples of variables used together with filters to modify their output:
| Input | Description | Output |
|---|---|---|
{for item in feed.yoga_classes.following_classes|slice:"0:3} |
In a for loop, limits the number of items to display |
Power Flow Yoga Evening Restorative Hatha Yoga Basics |
{{ contact.FIRSTNAME|upper }} |
Converts the recipient’s first name to uppercase (originally: Abby). | ABBY |
{{ params.TOTAL|floatformat:2 }} |
Displays the cart total with two decimal places (originally: 49.995). | 49.99 |
{{ time_now|date:"02/01/2006" }} |
Formats the current date as dd/MM/yyyy (originally: 2025-03-11 15:10:20.823713502 +0100 CET). |
11/03/2025 |
➡️ To learn more, check our dedicated article Modify the formatting of your placeholders with filters.
🤔 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.
If you’re looking for help with a project using Brevo, we can match you with the right certified Brevo Agency partner.