Skip to main content

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

❗️ Important
This feature is only accessible to our BrevoPlus users 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:
    • Enable the Developer mode if you use the Drag & Drop Editor. Else, use the HTML editor to create your email. 
    • Enable the external feed feature on your account and, if necessary, help you set it up with our API
  • Your API has to be hosted at an accessible URL in JSON format.
  • Retrieve your Brevo API v3 key.
  • 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, check our dedicated API documentation:
    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️⃣ Set up your external data feed via API 

Create your external data feed with our API. To learn how to create your external data feed, check our dedicated article on our API documentation

Once your external data feed is set up, create an email template and connect your external data feed to it ⬇️.

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.

💬 Was this article helpful?

0 out of 1 found this helpful