Personalize your emails using real-time data for more relevant and engaging content. Brevo's data feed pulls the latest information from your external sources or API, delivering personalized content at the time of sending. Use it for inventory updates, reminders, or recommendations, for example, to deliver timely and tailored messages.
Which emails can be personalized with data feeds?
Data feeds can be used in:
- Promotional emails and newsletters sent through campaigns.
- Automated emails sent through automation.
- Transactional emails triggered from a website via an eCommerce plugin or API.
Before you start
- Make sure you’ve learned all about data feeds in our dedicated article About data feeds in Brevo.
- Create the data feed that you will be using to personalize your email content. To learn more, check our dedicated article Create a data feed.
- Create an email template or campaign in which you want to insert your data feed variables and access the Design step. Data feeds can be inserted into emails designed with the drag and drop email editor or HTML editor.
Repeatable vs. non-repeatable data feed variables
|
To insert data feed variables into your email, you first need to wonder if this data is a:
-
Single object data (non-repeatable)
This data is a single object at the root of the data feed, directly accessible. It is the data that represents the most relevant, immediate, or ongoing entity. In our example above, next_yoga_class is the root object that contains only one object since there is only one immediate next class. This data can be inserted into your email directly.
➡️ Follow the steps from Step 2: Insert data feed variables into your email content. -
List/arrays data (repeatable)
Data stored in an array represents multiple past or future occurrences of similar entities, all stored in a separate object. In our example above, following_classes is an array that contains multiple items, all stored as a separate object, since there can be multiple future classes scheduled. To insert this data, you need to use a Dynamic content block to loop through the list and repeat each item stored.
➡️ Follow the steps from Step 1: Insert a dynamic content block to repeat data.
Step 1: Insert a dynamic content block to repeat data
If you want to insert non-repeatable data, you can directly follow Step 2: Insert data feed variables into your email content. However, if you want to loop your data to create a list of items in your email design, you first need to insert a Dynamic content block.
In our example, we want a section at the end of our email to propose other upcoming yoga classes if our recipient is not available for the first available class:
- From the email editor, drag and drop the Dynamic content block into your canvas. The block settings open in the left panel.
-
From the Data source dropdown, select Data feed.
💡 Good to knowYou can select a different data source for each Dynamic content block inside your email design.
-
Choose the data feed you want to use to personalize your email (e.g., yoga_classes).
-
Choose the specific array where the data variables are stored (e.g., following_classes).
-
By default, we limit the number of items to repeat to 3, but you can change it anytime. In our example, we want to limit the number of next yoga classes displayed to 4:
- From the Dynamic content block settings in the left panel, open the Layout section.
- The Limit number of items option should be activated by default.
- From the Number of items fields, click +/- or enter the maximum number of times your dynamic content block should be looped. In our example, we will enter 4.
- Optional: By default, the Index is set to 0. The index determines the position of elements in the array and starts from index 0 for the first element, 1 for the second, and so on. To start your list from the second item instead, enter 1.
Congratulations! 🎉 Now all the data feed variables you will insert in your email will be looped to create a list of items such as a list of products, events, and more! When a Dynamic content block is inserted, the section and its content blocks feature a database and curly brackets icon:
Step 2: Insert data feed variables into your email content
Choose the data to include in your email by adding data feed variables to your email. When the email is sent, these variables will be replaced with the relevant information for each recipient.
- Insert the content blocks you want to use to display the data from your data feed. For example, you can use:
- An Image block to show a picture of the items or related to them.
- A Text block to display details, such as the class names, locations, or dates in our example.
- A Button to redirect to a URL, such as the register form or event schedule in our example.
-
Add event variables inside your content blocks. Expand the following accordions to learn how to add variables for each type of content:
🔠 Add a variable to textAdd a variable inside a content block containing text to display specific details related to an item, such as a name, location, or date here.
- Click a content block containing text (Title, Text, or Button blocks).
- Place your cursor where you want to add a variable.
- Click the Add variable { } icon in the formatting bar.
- From the Which attribute would you like to insert? dropdown, select the variable you want to include in the email ("class_name", "studio_location", etc.).
To insert a non-repeatable data feed variable, you need to select Data feeds > feed name > object name > variable and then the variable, in our example, it would be Data feeds > yoga_classes > next_yoga_class > class_name. - (Optional) In the Which value should be used if the attribute is empty? field, enter the fallback text to use in case the value is missing for a data feed variable.
- Click Insert. The variable will be inserted, and a tag will appear in your content block.
- Repeat the steps for each variable you want to add to text.
🖼️ Add a variable to an imageAdd a variable to an Image block to display the image associated with an item, such as an event picture.
- Click an Image block.
- From the sidebar, go to Image settings.
- In the Insert image from URL field, click the Add variable { } icon.
- Select the variable you want to use to display your image.
- To insert a non-repeatable data feed variable, you need to select Data feeds > feed name > object name > variable and then the variable, in our example, it would be Data feeds > yoga_classes > next_yoga_class > image.
🔗 Add a variable as a hyperlink on textAdd a variable as a hyperlink on text to direct recipients to the URL associated with an item, such as a register form or event schedule page.
- Click a content block containing text (Title or Text blocks).
- Highlight the text where you want to add the link.
- Click the Link 🔗 icon in the formatting bar.
- In the Link target field, click the Add variable { } icon.
- Select the variable you want to use to generate your link.
To insert a non-repeatable data feed variable, you need to select Data feeds > feed name > object name > variable and then the variable, in our example, it would be Data feeds > yoga_classes > next_yoga_class > url. - Click Insert.
🔗 Add a variable as a hyperlink on an imageAdd a variable as a hyperlink on an image to direct recipients to the URL associated with an item, such as an event page.
- Click an Image block.
- From the sidebar, go to Link settings.
- In the Link target field, click the Add variable { } icon.
- Select the variable you want to use to generate your link.
To insert a non-repeatable data feed variable, you need to select Data feeds > feed name > object name > variable and then the variable, in our example, it would be Data feeds > yoga_classes > next_yoga_class > url. - Click Insert.
🔗 Add a variable as a hyperlink on a buttonAdd a variable as a hyperlink on a button to direct recipients to the URL associated with an item, such as a product page.
- Click a Button block inside a Dynamic content block.
- From the sidebar, go to Link settings.
- In the Link target field, click the Add variable { } icon.
- Select the variable you want to use to generate your link.
To insert a non-repeatable data feed variable, you need to select Data feeds > feed name > object name > variable and then the variable, in our example, it would be Data feeds > yoga_classes > next_yoga_class > url. - Click Insert.
(Optional) Step 3: Show or hide content based on specific conditions
Personalize your emails further by dynamically showing or hiding content elements based on specific conditions. This ensures that only relevant content is displayed to each recipient, based on their attributes, event data, or device type.
Expand the following accordions to see examples of how you can control content visibility in your emails:
Show or hide content based on the information stored in a recipient's contact attributes.
➡️ To learn more, check our dedicated article Show or hide content based on contact attributes.
Show or hide content based on the recipient's device type (mobile or desktop).
➡️ To learn more, check our dedicated article Show or hide content based on device type.
Step 4: Preview and test your email personalized with data feed variables
To ensure that the content in your email will display correctly in your recipients' inboxes, we highly recommend previewing and testing your email before sending it.
Click the tab below corresponding to the method with which you want to test your email:
- When your email design is ready, click Preview & test in the top bar of your email editor.
- Stay on the Preview tab.
- In the Who would you like to preview this email as? field, start entering one of your contact's email addresses and select it.
- Your preview for this contact generates automatically on the left of your screen. If you created a personalized data feed, enter another email address to check how the email will display for each contact according to their contact attributes.
- When your email design is ready, click Preview & test in the top bar of your email editor.
- Click the Send test email tab.
- In the Recipient field, start entering the email address of a contact from your test list and select it.
- Click Send test.
- Your test email will be sent shortly to the email address you entered with live data from your data feed. If you created a personalized data feed, send a test to another email address to check how the email will display for each contact according to their contact attributes.
Congratulations! 🎉 You can now use your email in your automations or send email campaigns containing live data from your data feeds.
Email template | Email in recipients' inboxes |
---|---|
⏩ What's next?
- Personalize your email subject lines and preview text with real-time data (data feeds)
- Personalize your SMS messages with real-time data (data feeds)
- Display a personalized list of items in automated emails (Abandoned cart, Order confirmation)
🤔 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 expert partner.