Skip to main content

Hey guys,
I am working on a email template that should be populate with the rss web feed. the problem is the value in the “content:encoded” key from my rss feed contains html tags and when i was testing the template it did not remove the html tags in preview as shown in image

and in email too :
{
  "rss": {
    "@version": "2.0",
    "@xmlns:content": "",
    "@xmlns:wfw": "",
    "@xmlns:dc": "",
    "@xmlns:atom": "",
    "@xmlns:sy": "",
    "@xmlns:slash": "",
    "channel": {
      "title": "Tiket Dana – Sportske Vesti",
      "atom:link": {
        "@href": "",
        "@rel": "self",
        "@type": "application/rss+xml"
      },
      "link": "",
      "description": "",
      "lastBuildDate": "",
      "language": "",
      "sy:updatePeriod": "",
      "sy:updateFrequency": "1",
      "generator": "",
      "item": e
        {
          "title": "",
          "link": "",
          "comments": "",
          "dc:creator": "",
          "pubDate": "",
          "category": "",
          "guid": {
            "@isPermaLink": "",
            "#text": ""
          },
          "description": "",
          "content:encoded": "<div class=\"sport-ispred-teksta-clanka-2 sport-target\" style=\"margin-left: auto; margin-right: auto; text-align: center; \" id=\"sport-1462414046\" data-advadstrackid=\"965\" data-advadstrackbid=\"1\"></strong></h2><div class=\"essb_links essb_displayed_1714071148 essb_share essb_template_default4-retina essb_template_glow-retina essb_766845790 essb_size_m essb_links_center essb_icon_animation5 print-no\" id=\"essb_displayed_1714071148_766845790\" data-essb-postid=\"3298\" data-essb-position=\"1714071148\" data-essb-button-style=\"icon\" data-essb-template=\"default4-retina es


Is there a way that the text in content:encoded can show without html tags in the email?

Hi @sportsrbija

 

Welcome to the Community! Happy to help! 

 

I know that usually a striptag is helpful for getting rid of unwanted HTML that’s pulled in, as Joe mentions in this thread below, but I’ll need to check back w the template team to see if this would specifically help your case here.

 

Tapping in some of our more developer-minded Champions to see what they have to say here for a possible solution! @Omar @retention @DavidV any ideas here?

 

-Taylor 


HI @Taylor Tarpley ,
Thanks it did work. But the formatting is gone. Is there any possible way that i can show the text as html intend it to be shown?


Hi @sportsrbija

 

As the expected behavior for an RSS Feed isn’t supposed to strip html tags that come through, I would investigate adjusting your RSS code to not include these tags in the value. 

 

If you need help working on that code I’d tag one of our Klaviyo partners, or the Champions I linked above to help create that for you! 

 

-Taylor 


@sportsrbija May I ask how you wrote the variable to be able to show the content? I’m new to JSON and I haven’t been able to show the content, I was able to show Title, Description, etc. But not the content:encoded. Is there a specific way to write it?


Reply