Solved

how to use RSS feed in email

  • 29 December 2020
  • 16 replies
  • 2535 views

Badge +2
  • Contributor I
  • 0 replies

I set up xml feeds successfully in Klaviyo from RSS feeds from Shopify blogs… I did my very best to follow the one article that describes doing dynamic content, but it does not work… anyone have thoughts?

 

also, there is no indication of how Klaviyo can pickup just the latest/new content since the last email went out, like Mailchimp does. any ideas?

icon

Best answer by k.mcevoy 30 December 2020, 17:50

View original

16 replies

Badge +1

I have problems to pull an image from an rss feed to a template, but I'm not sure if it's Klaviyo's problem or some particularity of how I built the XML, I'm not a developer so my knowledge is little, I would like to know if you could share with me an example xml to rebuild mine.

 

 

Badge +2

Hello Group!


I know this thread is OLD but I can’t find any updated information - the help on this is the worst!  Does anyone have a video of the NEW EDITOR getting this work?  I hate reading help section with no real complete examples of coding and syntax.

I was able to setup the “WebFeeds”  but after that adding to a creative is a no go.

 

If someone could just post some complete code (HTML) that I can see and test and I can figure it out from there.

Title
Description
Image
Date

 

Thank you

-Eric

Good Day Group,

I have it working now. 

Userlevel 7
Badge +60

Hello @Vlad Varela,

Thanks for being a member of the Klaviyo Community!

Since webfeeds can be set up in a wide variety of formats based on the type of information you are passing, there wouldn’t be an example XML file we can provide for use as an example. I would first recommend testing and validating your feed to make sure your feed is being accessed successfully by Klaviyo. 

After testing and validating that your feed is being accessed correctly by Klaviyo, I would recommend also double checking to ensure you are using the correct JSON variables and Django filters to reference the image you want to display within your email. Resource that may help you use the correct variables and filters are the Guide to Adding a Custom Web Feed in an Email article and the Django Documentation Guide

I hope this helps!

David

Badge +2

@Uppli 
I was not able to get a working RSS feed to display images. I did find this link that has some good information though. https://www.webmarked.net/how-to-email-blog-articles-using-klaviyo-and-smart-rss-feed/

I have learned that each RSS feed I try, as noted in some of the help articles, a lot has to do with the formatting of the output of the feed.

It also looks like they updated some content on this help page: https://help.klaviyo.com/hc/en-us/articles/115005258768

You first need to “Setup you feed”.  Next add the feed to the “email” in the “Display Options” of a “Text” box.  Once you have done that go back to the “Styles” tab and enter your variables as needed to display rss content.  This is the tricky part as it depends on the feed info.  Referring to the top link info, click on the </> when viewing in the “Styles” tab.  This will take you to the HTML of this section.  Add this:

<p><a href="{{ item.url }}">{{ item.title }}</a></p>

<p><img src="{{ item|lookup:'media:content'|lookup:'@url' }}" /></p>

<p>{{ item.description|slice:':255' }} <a href="{{ item.url }}">Read More</a></p>

I’ve tried a few different feeds and was not able to get an image to display.  I’m sure it’s something silly I’m just missing but I’ll continue to play around with it and update as I find new-working info.

If anyone out there has all this working, please list the feed you are using and the HTML used to get images to show etc. so we can clone and then take it from there.
 

Badge +6

Hi David,

With reference to the above image.

If I have to display “@length” in the feed what should be the syntax-

{{ item.enclosure."@length" }} or something else?

Userlevel 7
Badge +60

Hey @pankaj,

To access data nested within the first-level variables, you’ll want to use the dot notation. So, yes, in theory, to access the “@length” variable from the example, you’ll want to use the {{ item.enclosure."@length" }} syntax. 

I think you’ll also find the Populate Feed Content in Your Template section in the Guide to Adding a Custom Web Feed in an Email Help Center article helpful for understanding this!

David

Badge +6

Hi @David To ,

I’ve gone through the documentation multiple times.

The syntax isn’t working for variables with # and @.


Refer the image, my Repeat for value is feeds.Feed_name.feed.entry

 

I’m trying to fetch nested variables (@type & #text) from title variable.

{{ item.title."@type" }}  & {{ item.title."#text" }}  gives following error.
  

I’m able to get the rest of the variables.

 

Userlevel 7
Badge +60

Hey @pankaj,

Instead of using the {{ item.title."@type" }}  and  {{ item.title."#text" }} syntax, I may suggest using the {{ item.title|lookup:"@type" }} format as those special characters within your feed may end up being encoded otherwise causing this error. 

If you’re having further troubles with this, it may also be a good idea to reach out to our wonderful Support Team who can take a more comprehensive look into the cause of this issue or finding an accredited Klaviyo Partner who can provide more hands on support on implementing this solution!

David

 

Badge +6

Thanks @David To that was really helpful.

Could you please let me know what should be the syntax in the following case, when you want to fetch the first “@href” only?
 

 

Userlevel 7
Badge +60

Hey @pankaj,

Like many array conventions, you’ll want to use a zero-based index notation to reference those array nodes. Because of this, you can use a 0 to reference the variables in the first node of the array! 

David

 

 

Userlevel 4
Badge +6

Hi there, 

 

Thanks for contributing to the Community! Is this the article you followed to add the dynamic content? What is the syntax you are using within your template that is not populating correctly? If you are updated the RSS feed with the latest blog post, Klaviyo will automatically detect the newest post and pull it from the top of the feed. You have the option to limit the number of posts you wish to display in your feed with Django Filters: 

 

Thanks again for being a member of the Community!

 

Kelsey 

 

Badge +6

Thanks @David To 
Is this syntax Klaviyo specific or for a particular programming language? May I know the name of that programming language?

Userlevel 7
Badge +60

Hey @pankaj,

Similar to most email providers, Klaviyo emails are written in HTML. As previously mentioned in this thread, Klaviyo uses Django for template tags and filters. 

David

Hey @EMail1Dude can you plz share the solution how you have fixed it.

Badge +2

Hello Group!


I know this thread is OLD but I can’t find any updated information - the help on this is the worst!  Does anyone have a video of the NEW EDITOR getting this work?  I hate reading help section with no real complete examples of coding and syntax.

I was able to setup the “WebFeeds”  but after that adding to a creative is a no go.

 

If someone could just post some complete code (HTML) that I can see and test and I can figure it out from there.

Title
Description
Image
Date

 

Thank you

-Eric

Badge +2

@Uppli give me a little time to go back and look.  I was never able to fully get it working as I needed and thus moved to a different platform because of it.  I’ll go back to my tests and post what I was able to get working.

Reply