How to Use RSS Feed in Campaigns

An RSS (aka Really Simple Syndication) Feed is an easy way to share the most up-to-date content you've published on your blog or website.

With Sendlane, you have access to a built-in email feed that you can use to send newsletter updates to your audience -- automatically!

In this article we'll cover:


Before Getting Started

Please be sure you have an active RSS feed set up, and know the URL for that feed.

  1. Click New Campaign inside of the Campaigns tab
  2. Enter a name for your campaign and check the RSS Feed box
  3. Choose the format of your feed (either RSS or JSON) and enter the URL
  4. Click Next: Audience to continue the process of building your campaign, and move on to the next section!

Building an RSS-Based Campaign

With the Sendlane RSS feed reader, you can display the following properties for each post:
  • title
  • description
  • content
  • image - html <img> tag
  • image_url
  • author
  • link
  • date

RSS works in both of our email builder formats (drag-and-drop or HTML) and uses the same syntax.

Printing Details of a Single Post

Use ‘.0’ for the first post, ‘.1’ for the second post, etc. in the following syntax (keeping only the items you need):

{{ RSS.items.0.title }}

{{ RSS.items.0.description }}

{{ RSS.items.0.content }}

{{ RSS.items.0.image }}

{{ RSS.items.0.image_url }}

{{ RSS.items.0.author }}

{{ RSS.items.0.link }}

{{ RSS.items.0.date }}

Printing a Loop of Posts

Use the following syntax (keeping only the items you need):

{% for item in RSS.items %}

    {{ item.title }}

    {{ item.description }}

    {{ item.content }}

    {{ item.image }}

    {{ item.image_url }}

    {{ item.author }}

    {{ item.link }}

    {{ item.date }}

{% endfor %}

Please Note

By default, the feed grabs up to 20 items, but this limit can be increased if needed.

Slicing Your Content

To only print 3 items instead of 5, use the ‘slice’ command:

{% for post in JSON|slice(0,3) %}

Randomizing Your Content

To pick a few "random" posts from your feed:

{% set post1, post2 = random(9), random(9) %}

{{ RSS.items[post1].title }}

{{ RSS.items[post1].image }}

{{ RSS.items[post2].title }}

{{ RSS.items[post2].image }}


Troubleshooting

  • Email Builder Errors - Check your HTML code! It could be that there's a typo, a formatting error, or something as simple as a tag that wasn't closed!

  • Content isn't displaying as expected - Are you reviewing a Completed campaign? RSS feed content displays in the Preview (before sending) as well as once the email lands in your inbox, but you'll see the HTML code when viewing a Completed campaign from inside of your Sendlane account.

If you hit any other roadblocks, you can get in touch with our team of email marketing automation experts right here!

Did this answer your question? Thanks for your feedback! There was a problem submitting your feedback. Please try again!

Still need help? Get in touch! Get in touch!