Use an external data feed to send up-to-date or personalized email campaigns

❗️ Important
This feature is only accessible at an additional cost to our Enterprise users and using the HTML or Drag & Drop editor

Email marketing is a powerful tool for engaging customers and growing your business. To enhance its effect, use external data feeds to create personalized and up-to-date content. With real-time data, your messages can be relevant and timely, thus standing out in your customers' inboxes.

What is an external data feed? 

External data feed acts as a bridge between Brevo and your external API, by dynamically fetching dynamic data from external sources and incorporating it into your email campaigns for personalized and up-to-date content. Use only one email template for multiple use cases and update the feed! 

Depending on your needs, you can create two types of external data feeds:

  • 👥 Global feed
    All recipients will receive the same email containing the same information. For example, if you have a website with articles on pet health, you could create a monthly newsletter containing the top 5 trending advice or videos on your website this week.
  • 👤 Personalized feed
    Each recipient will receive the same email, but containing unique information based on their contact attributes. For example, if you have a website with articles on pet health, you could send a monthly newsletter containing only articles and videos based on the pet your recipients (cat, dog, rabbit...) have chosen when they signed up for your newsletter.
❗️ Important

If a general error that applies to all your contacts occurs during the sending of your email campaign that contains an external data feed, all recipients will be skipped. Access your email campaign report to view the reasons for the skip.  

If an error that applies to one of your specific contacts occurs during the sending of your email campaign that contains an external data feed, that contact will be skipped

Before you start

  • Contact your Customer Success Manager (CSM) to:
    • Activate the external feed feature on your account and, if necessary, help you set it up
    • Enable the Developer mode if you use the Drag & Drop Editor. Else, use the HTML editor to create your email. 
  • Your external data has to be hosted at an accessible URL in JSON format.
  • Create the email template in which you want to add an external data feed. To learn more, check our dedicated article Create an email template
  • To help you understand how to set up and use an external data feed into your email templates, we created a use case for illustration purposes that you can easily adapt to your needs: Show articles on pet health and behavior.
    For reference, this is an example of the content Brevo should have access to via the external feed. Your IT team can set up the external feeds you need:
    external-feed_example-api-petlover_EN-US.png

1️⃣ Optional: Create a contact attribute for a personalized feed

To create personalized content for each recipient using an external data feed, you need to create a contact attribute related to the external data feed you want to retrieve. The contact attribute will provide information about the recipient's preferences to your external data feed, allowing it to understand which content the recipient would like to receive. To set up the API for a personalized data feed, check our dedicated API documentation.

To create a contact attribute for your external feed:

  1. Go to Contacts > Settings > Contacts attributes
  2. Click + Add a new attribute
  3. Enter your attribute name and select an attribute type
  4. Click OK
  5. For each recipient receiving this newsletter, enter a value for your newly created attribute. 
    In our use case, we want to display information about our recipient's pet, so the value for the PET attribute could be cat, dog, or any other pet name accessible in the API and data feed.  
    external-feed_pet-attributes-contact-list_EN-US.jpg
    💡 Good to know
    Add this attribute as a field to your subscription form to allow your contacts to choose their preferences. Then create an automation workflow to automatically add contacts to a specific list according to their preferences. For example, if when subscribing to your newsletter, your contact selects Cat as their pet, the PET attribute will automatically be filled, and they can be added to the Cat lovers contact list. 

2️⃣ Create and set up your external data feed with your Brevo account

💡 Good to know
You can also set up your external feeds with our API. To learn how to create your external data feed, check our dedicated article on our API documentation.

Use our almost no-code wizard to connect and configure your external data feed with your Brevo account:

  1. Go to your account drop-down > Data feeds
  2. Click Add data feed. You are redirected to the feed setup flow.
  3. Name your data feed to easily find and recognize it in your list and click Continue. In our example, we will call it Pet preferences
  4. In the External source URL field, paste the link to your API hosted at an accessible URL in JSON format and containing your external data. 
    data-feed_set-up-feed_EN-US.jpeg
  5. (Optional) To create a personalized feed:
    1. Click {} next to the External source URL and select the Brevo contact attribute that contains your contacts' preferences.
      The value of your contacts' attribute in Brevo will be compared with the data from your external feed during the API call to display only the data relevant to them at the time of sending. In our example, we will select the PET attribute so that if a recipient's PET attribute is Cat, we will only show the data from the Cat category. 
    2. Select a default preview contact from the drop-down list. You can only select contacts from your test list. In the next screen, we will display a preview of the data that the server was able to retrieve for this specific contact thanks to their Brevo contact attribute. 
      This preview will allow you to ensure that you successfully retrieve the data that corresponds to the attribute of the contact you selected. In our example, we want to show the data for John B. <John.b@example.com> whose PET attribute is Cat
  6. Choose the authentification method that protects your external data source and enter your credentials to access it.
    • No authentication
    • Basic
    • Token
    • Headers
  7. Click Continue
  8. Check the preview of your external data feed. Ensure the data retrieved for this external data feed is correct. If you've added a contact attribute for a personalized feed, select other contacts from your test list to ensure that the personalized data retrieved is the right one for each contact.
    data-feed_check-preview-feed_EN-US.jpeg
  9. Click Save

Congratulations! 🎉 Your external data feed is created and set up in your Brevo account. If you want to edit or delete this external feed, click the three dots next to the feed name on the Data feeds page of your Brevo account.

3️⃣ Connect your external data feed to your email template

Depending on the design tool you chose, the steps and syntax to connect your external data feed to your email template are different: 

Drag & Drop Editor HTML editor
  1. From the Drag & Drop Editor, click more-action-icon.png > Developer mode to open the code editor. 
    ddde_access-developer-mode_EN-US.jpg
  2. Copy the following placeholder and paste it after the subject line:
    feeds:
      -
       name: myvariable
       source: feedname
  3. In this placeholder, replace:
    • myvariable with the name you want to give to your variable to later access feed data, here petlover.
    • feedname with the name of your feed as defined in your API, here petloverfeed.
      external-feed_developer-mode-feed-setup_EN-US.jpg
      ❗️ Important
      Be careful to write the feedname exactly how it appears in your API setup as it is case-sensitive. For example, if your feed name is petloverfeed and you write Petloverfeed, the connection between your email template and your external feed will fail. 
  4. Close the developer mode by clicking the close icon.

4️⃣ Access the external data feed in your email template 

Your external data feed is set up and connected to your email template. It is now time to access the data contained in your external data feed to display it. Each data will be called separately with variables according to the information you want to display.

Depending on the design tool you chose when creating your email, the steps and syntax to access your external data feed are different: 

Drag & Drop Editor HTML editor
  1. From the Drag & Drop Editor, insert a content block where you want to display your data. 
    drag-drop-content-block_EN-US.gif
  2. Copy the following placeholder:
    {{ feed.myvariable.field }}
  3. In your content block, paste the placeholder for each data you want to retrieve from your external data feed. Leave feed as is and replace:
    • myvariable with the variable alias or the name of your variable, here petlover
    • field with the field's name in the API that contains the data you want to retrieve. For example, if you want to retrieve the title from your external feed, replace field with title.
      Drag & Drop Editor Email preview
      external-feed_dee-tempalte_EN-US.png external-feed_dde-editor-example-preview_EN-US.jpg
  4. To retrieve an image, click the image icon and paste the placeholder in the Insert image from URL field, here:
    {{ feed.petlover.small }}
    external-feed_dde-insert-image_EN-US.jpg
  5. To add a link to a button, insert a button block and click Add a link. Choose Absolute link (URL) and paste the placeholder in the Link target field, here:
    {{ feed.petlover.link }}
    external-feed_dde-insert-link_EN-US.jpg
  6. Optional: To display the same content block multiple times to show, for example, the top 5 trending articles on your website, use the repeat block feature. To learn more, check our dedicated article Repeat a block of items in your emails.
  7. Once you are done designing your email template, click Save & Quit

5️⃣ Test your email template

To ensure that your email content will display correctly in your recipients' inboxes, we highly recommend testing your email template. The best way to test an email template with product feed data is to send a test email. To learn more, check our dedicated article Preview and test your email campaign.

Congratulations! 🎉 You can now use your email template in your automations or send email campaigns containing external data feeds.

❓FAQ 

What are the common errors that can be faced during the sending of an email campaign with an external data feed? 

The most common errors that can be faced are: 

  • The external feed either does not exist or its definition is incorrect in the template. 
  • External feed placeholders are defined incorrectly in the template. 
  • An API issue prevents access to the external data feed. (Error 403: Forbidden). 

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

If you’re looking for help with a project using Brevo, we can match you with the right certified Brevo expert partner.

💬 Was this article helpful?

0 out of 1 found this helpful