Email marketing is a powerful tool for engaging customers and growing your business. However, nowadays, customers are contacted via many communication channels and receive dozens of advertising emails daily. One way to make your email campaigns even more effective is to use external data feeds to create personalized and up-to-date content. Using real-time data, you can ensure that your messages are relevant and timely, making them stand out in your customers' inboxes.
What is an external data feed?
External data feed acts as a bridge between Brevo and your external API. It allows you to dynamically fetch and incorporate data from an external source into your email campaigns, making them highly personalized and up-to-date.
Using an external data feed, you can leverage real-time data to create highly personalized and dynamic email campaigns that are optimized for engagement and conversions. Use one email template for multiple use cases and update the feed. This not only saves you time by automating the process of updating your content but also ensures that your campaigns always deliver fresh, relevant content.
You can create two different external data feeds depending on your needs:
- 👥 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.
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:
1️⃣ Optional: Create a contact attribute for a personalized feed
If you want 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:
- Go to Contacts > Settings > Contacts attributes.
- Click + Add a new attribute.
- Enter your attribute name and select an attribute type.
- Click OK.
- 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.
💡 Good to knowAdd this attribute as a field to your subscription form to allow your contacts to choose their preferences. You can also 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, you can 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:
- From the Drag & Drop Editor, click
> Developer mode to open the code editor.
- Copy the following placeholder and paste it after the subject line:
feeds:
-
name: myvariable
source: feedname - 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.
❗️ ImportantBe 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.
- Close the developer mode by clicking the close icon.
- Copy the following placeholder and paste it into the HTML editor at the beginning of your HTLM code before the body tag:
!-- feed.myvariable : {{ feed.get ("feedname") }} -->
- 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.
❗️ ImportantBe 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️⃣ 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:
- From the Drag & Drop Editor, insert a content block where you want to display your data.
- Copy the following placeholder:
{{ feed.myvariable.field }} - 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
- To retrieve an image, click the image icon and paste the placeholder in the Insert image from URL field, here:
{{ feed.petlover.small }} - 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 }} - 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.
- Once you are done designing your email template, click Save & Quit.
- Copy the following placeholder and paste it where you want your external data to display in the email template:
{{ feed.myvariable.field }} - In this placeholder, 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 small image from your external feed, replace field with small.
HTML editor Email preview
- Optional: To display the same content block multiple times to show, for example, the top 5 trending articles on your website, use for-loops. To learn more, check our dedicated article Advanced - Repeat a block of items using for-loops.
- Once you are done designing your email template, click Continue.
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 external feed data is to send a test email.
- Click Send test email.
- Enter one or more email addresses to which you want to send a test.
- Access the email inboxes to which you sent the test and check the display of your email template. Make any necessary changes if needed.
- Once your email template is ready, click Save & Activate.
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?
- Creating an email campaign
- Creating an A/B Test campaign
- Repeat a block of items in your emails
- Advanced - Repeat a block of items using for-loops
🤔 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.