Personalize your emails with event data

When your contacts perform specific actions, such as making a purchase or booking a meeting, you can use the event data linked to these actions to personalize the emails they receive. This is especially useful in order confirmations, abandoned cart reminders, and other automated emails.

How does personalizing emails with event data work?

When creating an email template, you can add event variables. These variables are dynamic placeholders for specific details related to an event, such as the contact's name, order ID, and purchased items. 

When the event happens, Brevo receives the event data and automatically replaces the event variables with the actual data from the event. This ensures that, instead of receiving a generic message, the recipient gets a fully personalized email, making the experience more relevant and engaging.

In the following example, a customer placed an order with two products. The event variables in the email template were replaced with the actual data from the purchase, so the recipient received a fully personalized email, including specific details about the items she ordered ⬇️.

Email template in Brevo Email received in the inbox
email_dynamic-content_order-created_template_en-us.png email_dynamic-content_order-created_sent_en-us.png

Which emails can be personalized with event data?

❗️ Important
Because email campaigns are manual, one-time sends that are not triggered by a customer’s actions, event variables cannot be used in them.

Since event data is based on a customer’s actions, event variables can only be used in:

  • Automated emails sent through an automation.
  • Transactional emails sent through Brevo SMTP.

Expand the following accordion to view some concrete examples of emails that can use event data for personalization ⬇️:

Examples of emails that can use event data for personalization
Email Triggering event Event data
Order confirmation email A customer places an order
  • Customer's name
  • Order ID
  • Name, price, and quantity of purchased items
  • Order total
Order cancellation email A customer's order is cancelled
  • Customer's name
  • Order ID
  • Name, price, and quantity of purchased items
  • Order total
  • Cancellation reason
Shipping confirmation email A customer's order is shipped
  • Customer's name
  • Order ID
  • Name, price, and quantity of purchased items
  • Order total
  • Order tracking number
  • Estimated delivery date
Abandoned cart reminder A customer abandons their cart without completing the purchase
  • Customer's name
  • Name, price, and quantity of items left in the cart
  • Cart URL
Upcoming event, appointment, or trip reminder A customer books an event, appointment, or trip
  • Customer's name
  • Date and location of the event, appointment, or trip (e.g., March 15, 2025 at 3:00 PM - Yoga Retreat, Bali)
Next step suggestion A customer, user, or student completes a specific action
  • Person's name
  • Information about the completed action (e.g., "Completed your first module")
Product or content recommendation A visitor visits a specific page, blog post, or article
  • Visitor's name
  • Information about the page viewed (e.g., "Yoga Mat Review - 5-star ratings")

Before you start

  • Install the Brevo tracker on your website
    To track user actions and collect event data, make sure the Brevo tracker is installed on your website. To learn more, check our dedicated article What is the Brevo tracker and how to install it?.
  • (Optional) Create custom events
    Brevo automatically tracks many events. However, if you want to monitor specific user actions relevant to your business, you can create custom events and collect data linked to them. To learn more, check our dedicated article Create custom events in Brevo.

Step 1: Create an email template

First, create an email template.

  1. Go to Marketing > Templates.
  2. Click Create template.
  3. Select Email template.
  4. In the Setup tab, configure the settings of your template, including its name, subject line, and preview text.
    💡 Good to know
    You can personalize your subject line with event data by typing an event variable manually. To learn more about how event variables are formatted, check our dedicated section in the article [Manual] Personalize your messages with dynamic content (Brevo Template Language).
  5. Click Next step.
  6. In the Design tab, choose an email template or layout to use as your base, or create a new template from scratch.

Step 2: (Optional) Insert a dynamic content block to repeat event data

❗️ Important
Some event data, such as a cart summary link or order total, doesn’t need to be repeated. In this case, you do not need to add a dynamic content block to your email template and can insert the event data directly into a regular Title or Text block.

Use a dynamic content block when you need to repeat information, such as the names or prices of purchased items. This lets you display multiple items as a list by looping through the event data.

  1. From the email editor, drag and drop the Dynamic content block into your canvas. The block settings open in the left panel.
    email_add_dynamic-content-block_en-us.png
  2. Click the Dynamic content section in your email template.
  3. From the Data source dropdown, select Event data.
    email_dynamic-content-block_event-data_en-us.png
  4. Choose the event you want to use for personalizing your email (e.g., eCommerce events > order_created).
    email_dynamic-content-block_event-data_event°en-us.png
  5. Choose the specific array where the event data is stored (e.g., items).
    email_dynamic-content-block_event-data_event_array_en-us.png

Step 3: Add event variables to your email template

Add event variables to your email to include personalized data, such as product names, prices, or a cart link. When the email is sent, these variables will be replaced with the correct information for each recipient.

  1. Insert the content blocks you want to use to display the event data. For example, you can use:
    • An Image block to show a picture of the items.
    • A Text block to display details, such as the item names, prices, or descriptions.
    • A Button to redirect to a personalized URL, such as a checkout or order summary link.
      ❗️ Important

      To repeat event data, such as the names or prices of purchased items, make sure to place the content blocks inside the dynamic content block you added in the previous step

      email_dynamic-content-block_add_content-block_en-us.png
  2. 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 text

    Add a variable inside a content block containing text to display specific details related to an event, such as an item price or a cart total.

    1. Click a Title, Text, or Button block.
    2. Place your cursor where you want to add a variable.
    3. Click the Add variable { } icon in the formatting bar.
      email_dynamic-content_text_variable_en-us.png
    4. From the Which attribute would you like to insert? dropdown, select the variable you want to include in the email template ("name", "price", etc.).
      email_dynamic-content_text_variable2_en-us.png
    5. (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.
    6. (Optional) If you selected a number-type attribute, enter the desired number of decimals in the Number of decimals to display field.
    7. Click Insert. The variable will be inserted, and a tag will appear in your content block.
      email_dynamic-content_template_en-us.png
    🖼️ Add a variable to an image

    Add a variable to an Image block to display the image associated with an item, such as a product photo.

    1. Click an Image block.
    2. From the sidebar, go to Image settings.
    3. In the Insert image from URL field, click the Add variable { } icon.
    4. Select the variable you want to use to display your image (usually "image").
      email_dynamic-content_image_variable_en-us.png

    🔗 Add a variable as a hyperlink on text

    Add a variable as a hyperlink on text to send recipients to a URL, such as a product page or a cart summary.

    1. Click a Title or Text block.

    2. Highlight the text where you want to add the link.
    3. Click the Link 🔗 icon in the formatting bar.
      email_dynamic-content_link-text_en-us.png
    4. In the Link target field, click the Add variable { } icon.
    5. Select the variable you want to use to generate your link (usually "url").
      email_dynamic-content_link-text-variable_en-us.png
    6. Click Insert.
    🔗 Add a variable as a hyperlink on an image

    Add a variable as a hyperlink on an image to send recipients to a URL, such as a product page or a cart summary.

    1. Click an Image block.
    2. From the sidebar, go to Link settings.
    3. In the Link target field, click the Add variable { } icon.
    4. Select the variable you want to use to generate your link (usually "url").
      email_dynamic-content-block_image_hyperlink_en-us.png
    5. Click Insert.
    🔗 Add a variable as a hyperlink on a button

    Add a variable as a hyperlink on an image to send recipients to a URL, such as a product page or a cart summary.

    1. Click a Button block. 
    2. From the sidebar, go to Link settings.
    3. In the Link target field, click the Add variable { } icon.
    4. Select the variable you want to use to generate your link (usually "url").
      email_dynamic-content-block_button_hyperlink_en-us.png
    5. Click Insert.

Step 4: (Optional) Limit the number of items repeated in your emails

➡️  For example
If you limit the number of items displayed in an order confirmation email to 3, only the details of 3 purchased items will be displayed, even if the customer purchased 10 items.

If you added a dynamic content block to your email template, its content will repeat for each item included in the email. By default, the number of items shown is limited to 3. This helps keep the message clear and visually appealing, while preventing the recipient from feeling overwhelmed.

email_dynamic-content_limit-items_en-us.png

To change the limit:

  1. In the Dynamic content block settings in the left panel, open the Layout section.
  2. The Limit number of items option should be activated by default.
  3. In the Number of items field, click the +/- buttons or enter the maximum number of times the Dynamic content block should repeat its content.

Step 5: (Optional) Show or hide content in your emails based on specific conditions

Make your emails more relevant by showing or hiding content based on specific conditions. Only display content that matches each recipient’s device, contact details, event data, or data feed.

➡️ To learn more, check our dedicated article Show or hide content in your emails (Content visibility).

Step 6: Preview your email template with real data

❗️ Important

We do not recommend using the View in inbox or Send test email options for emails personalized with event data. These options cannot be linked to real event data, so event variables will not be replaced.

Preview your email template to ensure it displays correctly in recipients' inboxes and that event variables are properly replaced with real data from an event.

  1. Click Preview & test.
  2. Select one of our test or preview option:
    Preview as recipient [Advanced] Preview event

    The "Preview as recipient" option lets you preview how your email will look for a specific contact by replacing contact variables with data from a selected contact and event variables with data from a manually entered JSON snippet.

    1. Select Preview as recipient.
    2. Select the contact you want to use to replace the contact variables.
    3. Activate the Add transactional JSON data.
    4. Enter the JSON snippet you want to use to replace the event variables. This data will replace the variables, and you will be able to preview the template with real event data.
    5. Once you're done previewing the email, close the window.

Step 7: Activate your email template and use it in Brevo

Activate your email template and use it in Brevo.

  1. From the email editor, click Save & quit to save your email template.
  2. Click Save and activate to activate your email template.
  3. You can now use your email template in different ways:

The event variables in your email will be automatically replaced with the relevant information for each recipient when the email is sent.

🤔 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.

💬 Was this article helpful?

4 out of 10 found this helpful