With the Dynamic content block, you can display a personalized list of items in your emails sent through an automation (automated emails). For example, if a customer leaves items in their cart, you can automatically send them an email containing a list of those products with details like names, images, and prices, to encourage them to complete their purchase.
Email template in Brevo | Automated email received in the inbox |
---|---|
In which cases can I display a personalized list of items in my automated emails?
Expand the accordions below to see examples of when to display a personalized list of items in automated emails:
Display a personalized list of items abandoned in the cart, showing product names, images, and prices, to encourage the recipient to return and complete the purchase.
Display a personalized list of items purchased, including product names, quantities, and prices, to confirm the details of the order.
Display a personalized list of items shipped, with product names, quantities, and prices. Include shipping details, such as the tracking number and estimated delivery date, to keep customers informed about their order's status.
Display a personalized list of items from the canceled order, with product names, quantities, and prices. Include a confirmation of the cancellation and provide details on the refund or next steps.
Before you start
- Install the Brevo tracker and make sure you've set up the events needed to create a personalized list of items in your emails. To learn more, check our dedicated article What is the Brevo tracker and how to install it?.
- Make sure you have at least one active eCommerce event (such as cart_updated, cart_deleted, or order_created) or custom event in your Brevo account. Go to the Event logs page and filter your track events to check if any applicable events are available.
If no events are visible, confirm that the Brevo tracker is correctly installed on your website and that you've set up the events needed to create a personalized list of items in your emails.
Display a personalized list of items in your automated emails
To display a personalized list of items in your automated emails, use a Dynamic content block and automation data variables in your email template. This block retrieves the data needed to generate the personalized list, replaces the variables with the relevant information for each item, and automatically repeats the pattern for all items in the list.
We'll use the example of an abandoned cart email, but you can easily adapt this approach to other use cases.
Step 1: Create an email template
First, you will create the email template to be used in your automation.
- Go to Automation > Templates.
- Click Create template.
- Select Email template.
- In the Setup tab, configure the settings of your template, including its name, subject line, and preview text.
- Click Next step.
- In the Design tab, choose an email template or layout to use as your base.
Step 2: Configure your data source
Create the email template to be sent through your automation and choose the data source for personalization. This data source will guide Brevo on where to retrieve the information needed to create the personalized list of items.
- 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 Automation data.
- Select the event that will be used to personalize your emails and the array that contains the values for each item (usually "items"). In this example, since we want to retrieve the list of items left in the cart by the contact, we'll select Ecommerce events > cart_updated > items.
-
Select the event that will be used to personalize your emails and the array containing the values for each item (usually labeled as "items"). In this example, since we want to retrieve the list of abandoned items, we'll choose Ecommerce events > cart_updated > items.
💡 Good to knowFor an order confirmation email, you would choose Ecommerce events > order_created > items. -
The Dynamic content block is designed to repeat itself for each item that should be displayed. By default, we limit the number of items to repeat to 3, but you can change it anytime. In this example, we want to showcase up to 5 items, so we need to limit the number of times the Dynamic content block will be looped:
- 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 5.
You have successfully selected your data source. It means Brevo will know where to retrieve the information needed to create the personalized list of items. We'll now learn how to add content to the Dynamic content block and insert variables that will be replaced with the relevant information for each item when the email is sent.
Step 3: Choose the data variables you want to include in your email template
You'll now insert the variables that will be replaced with the relevant information for each item when the email is sent.
- In the Dynamic content block, insert the content blocks you want to use to display the list of items. Typically, you would insert an Image block to show a picture of the items, and a Text block to display their details, such as their name and price."
- Add variables to your content blocks. These variables will be replaced with the relevant information for each item when the email is sent. Expand the accordions below to learn how to insert variables for each type of content:
🔠 Add a variable to text (name, price, quantity, etc.)
- Click a content block containing text inside a Dynamic content block (Title or Text 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 template ("name", "price", etc.).
- (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 product.
- (Optional) If you selected a number-type attribute, enter the desired number of decimals in the Number of decimals to display field.
- Click Insert. The variable will be inserted, and a tag will appear in your text block.
🖼️ Add a variable to an image- Click an Image block inside a Dynamic content 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 (usually "image").
🔗 Add a variable as a linkLink to text
- Click a content block containing text inside a Dynamic content block (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 (usually "url").
- Click Insert.
Link to an image
- Click an Image block inside a Dynamic content block.
- Click the Link 🔗 icon.
- In the Link target field, click the Add variable { } icon.
- Select the variable you want to use to generate your link (usually "url").
- Click Insert.
Link to a button
- Click a Button block inside a Dynamic content block.
- Click the Link 🔗 icon above the button.
- In the Link target field, click the Add variable { } icon.
- Select the variable you want to use to generate your link (usually "url").
- Click Insert.
Step 4: Test and save your email template
To ensure that the content in your email template will display correctly in your recipients' inboxes, we highly recommend previewing and testing your email before sending it.
- Click Preview & test.
- Select which option you want to use to preview your email:
- Select Preview as recipient.
- Select a contact.
- Activate the Add transactional JSON data.
- Enter the JSON data to test the email template. This data will replace the variables, allowing you to preview the template with the provided information.
- Once you're done testing the email template, close the window.
- Select Preview event.
- Select the event that will trigger the automation. In this example, we'll select Ecommerce events > cart_updated.
- Select a past event you want to use to test the email template. The data from this event will replace the variables, allowing you to preview the template with the provided information.
- Once you're done testing the email template, close the window.
- Click Save & quit to save your email template.
- Click Save and activate to activate your email template.
Step 5: Use your email template in an automation
You'll now be able to use your email template in the Send an email step of an automation.
- Go to Automations and create an automation.
- Add a trigger to your automation. In this example, since we want to retrieve the abandoned items, we'll use the "Cart updated" event to trigger our automation.
- Add the Send an email action to your automation.
- Select the email template you previously created.
-
Select the event that will be used to personalize your emails. There are two options you can choose from:
-
The event that triggered the automation
The items displayed in the email will be retrieved from the event that started the automation. For example, for an order confirmation email, you would retrieve the items from the "Order created" event which triggered the automation.❗️ ImportantThe event that triggered the automation should be an eCommerce event (cart_updated, order_created, or cart_deleted) or a custom event. -
The latest instance of an event
The items displayed in the email will be retrieved from the most recent occurrence of a specific event. For this abandoned cart example, we would retrieve the items from the latest instance of the "Cart updated" event to make sure we display the items currently abandoned in the cart.
-
The event that triggered the automation
- Finish setting up the Send an email step and the rest of your automation.
- Once you're done, activate your automation.
Congratulations! 🎉 Your recipients will now receive a personalized list of items in your automated emails based on the event you selected.
⏭️ What's next?
- Customize your emails with Brevo Template Language section
- Understand the dynamic content block (Data feeds and automation data)
- Send personalized emails by repeating real-time data with data feeds
🤔 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.