Skip to main content

Resolving HTML Tags in RSS Email Body

Issue

When using RSS feeds in your email campaigns, you might notice that the email body displays HTML tags, such as <p>, instead of rendering them correctly.

Solution

To fix this issue, you need to use the Custom RSS Item element in the email builder. Here's how to ensure your content renders properly:

  1. Use Triple-Stash for Content: Instead of using {{rss_item.content}}, switch to `{{{rss_item.content}}}`. This adjustment will prevent HTML tags from appearing in your emails.

Understanding HTML-Based RSS Feeds

When working with RSS feeds, the values returned by RSS-based custom variables, like {{rss_item.title}}, are HTML-escaped by default. This means:

  • Characters like & will appear as &amp;.
  • HTML-based text in your RSS feed will be displayed as plain text.

Preventing HTML Escaping

To avoid this automatic escaping and ensure your content displays as intended, use the "triple-stash" syntax. Here's a quick example:

  • Without Triple-Stash: Your RSS content may not render correctly, showing HTML tags.
  • With Triple-Stash: By using `{{{rss_item.content}}}`, your content will render as expected, displaying the intended HTML formatting.

By following these steps, you can ensure your RSS feed content is displayed correctly in your Stack email campaigns.