The content feed feature enables you to create a reusable email template and use a structured data file to provide specific content at send time. This feature is very helpful for content publishers who use email to distribute their syndicated content.
Maropost for Marketing uses the Liquid scripting engine for content personalization. You can use the same scripting language to display elements from the content feed in the email body.
You must ensure that the structured data file meets the following requirements:
- The URL of the structured data must not be a redirect to the actual resource.
- The data must be either XML or JSON-formatted.
- If you are passing in data as an array, then the array must be passed as a named element.
Adding Content Feeds:
- In Navigation, go to CONTENT, and then select Content Feed.
📋 Note: If you do not see the 'Content Feeds' menu option, then notify Success@maropost.com and we’ll activate it for your account right away. - In the Content Feed index page, you can add new content feeds by clicking one of the two following buttons:
- Add Single Feed – Use this option when you want only one content feed for your email.
- Add Merge Feed – Use this option when you want to combine multiple content feeds into your email.
- When adding single feed: On the New Single Feed dialog box, enter the name you want to use for the content feed. This is the name of the feed that will appear in the Content Feed library. Then, enter the URL for the feed.
When adding merge feed: On the New Merge Feed dialog box, enter the name you want to use for the merge feed. Then, in the Feed field, enter a key and the URL for the feed. The key you define here can then be used to refer to this feed when creating content or dynamic content.
📋 Note: You can add as many as 12 content feeds in a merge feed. - Optionally, from the Update Content Feed drop-down list, select a day and time to update the content feed.
📋 Note: You must select the option to update the content feed only if you will be using it for Workflow Messages or Transactional Messages. For normal broadcast messages, Maropost for Marketing pulls the data from the source URL and caches it when sending to all contacts targeted to receive the email. Workflow emails and Transactional emails are different types of emails. These types of emails are 1-to-1 emails, hence Maropost will be hitting your content server every time a Workflow email or a Transactional email is to be sent. Under certain circumstances, this scenario can put unnecessary load on the content server.
The 'Update Content Feed' option refreshes the cached version on a periodic basis to avoid repetitive hits to the content server. - Optionally, click the [Eye] icon to preview the content feed in a new browser tab.
This action is helpful to reference the elements in the feed when writing the Liquid script in the email content. - Click Save.
Using Content Feeds in Email Content
Since you will be combining Liquid scripting with your HTML code to display the elements of the content feed in the email, it is recommended that you use the HTML Code content editor. This is a pure code editor that gives you the best control over your HTML and Liquid scripting code.
In the content editor, click the Advanced tab. Then, from the Content Feed drop-down list, select the name of the content feed from those you’ve created in the Content Feed library. Click the [Eye] icon next to the Content Feed field to preview what the fully-assembled email will look like when it is sent to the contacts.
The following screenshot shows the Advanced tab of the HTML Code content editor:
Consider an example, let’s say you have a JSON-formatted content feed as follows:
Here, each news article is passed as a combination of elements in an array and that the array is named 'Content'.
The HTML code in your email content will look as following:
<h1>Newsfeed: {{newsfeed.newsfeed_name}}</h1> {% for feed in newsfeed.content %} <p><strong>{{feed.headline}}</strong></p> <p>Author : {{feed.author}}</p> <a href={{feed.url}}> Click here to read the full article</a> <p><a href="{{feed.social.facebook""">Follow us on Facebook</a></p> <hr /> {% endfor %}