Online
Bento

How to Pull RSS Feeds into Your Emails Using Liquid

You can pull your latest blog posts or articles into your email newsletters automatically. Bento supports this through the Liquid templating language and RSS filters.

Finding the Liquid Code

To get started, head over to the Liquid Tags. Look for the External Data and open it in a new tab. Scroll down until you find the code snippet for pulling in an RSS feed. Copy the code and paste it into your email template.

Customizing the RSS Feed

By default, the code snippet uses an example URL for the RSS feed. Replace this with the URL of your own RSS feed. This example uses the RSS feed from the New York Times. When you render the email, you'll see a JSON payload with various variables like title, description, and published date.

Formatting the RSS Feed

To make the RSS feed more readable, you can format it using Liquid tags. For example, you can bold the post title and include the post description below it. Simply wrap the post.title and post.description variables in the appropriate HTML tags. Render the email again and you'll see the formatted RSS feed.

To encourage readers to visit your website, you can include a "Read More" link for each post. Use the post.link variable to create a hyperlink to the full article. Render the email one more time to see the links in action.

Debugging Tips

If something isn't working as expected, debugging Liquid code is straightforward. Check the variable names and make sure they match the ones in the JSON payload. You can also use the view preview option to see how the email looks before sending it.

Summary

By using Liquid and RSS filters, you can pull your latest content into your emails automatically. Add formatting and "Read More" links to turn the raw feed into a finished newsletter section.

And as always, ping us in Discord if you have any questions!

Was this page useful?

Your answer helps us find docs that need work.