Solved

Dynamic email/flow content from web feed

  • 10 March 2021
  • 5 replies
  • 62 views

Badge

Hi - I have added a custom feed (from Wordpress RSS feed) and this is working fine in the feed preview.

However, I cannot get the content to dynamically populate an email. 

I’ve been through the instructions here: https://help.klaviyo.com/hc/en-us/articles/115005258768-Guide-to-Adding-a-Custom-Web-Feed-in-an-Email#populating-feed-content-in-your-template6

and searched on the forum, but just cannot get this working.

I have setup a text block and set the Repeat Block to feeds.PODCASTS.rss.chanel.item and the Alias item to ‘item’.

Then in the text block source I have added 

<h2>{{ item.title }}</h2>

<p>{{ item.description }}</p>

(both title and description are attributes in the feed)

Below is the output from the feed (to the end of the first item).

Any ideas where I am going wrong?

Thanks

Philip.

{ rss: { "@version": "2.0", "@xmlns:content": "http://purl.org/rss/1.0/modules/content/", "@xmlns:wfw": "http://wellformedweb.org/CommentAPI/", "@xmlns:dc": "http://purl.org/dc/elements/1.1/", "@xmlns:atom": "http://www.w3.org/2005/Atom", "@xmlns:sy": "http://purl.org/rss/1.0/modules/syndication/", "@xmlns:slash": "http://purl.org/rss/1.0/modules/slash/", channel: { title: "Podcast – Chalke Valley History Festival", "atom:link": { "@href": "https://cvhf.org.uk/podcasts/feed/", "@rel": "self", "@type": "application/rss+xml" }, link: "https://cvhf.org.uk", description: "21st to 27th June 2021 - The largest Festival dedicated entirely to History in the UK", lastBuildDate: "Wed, 10 Mar 2021 11:49:20 +0000", language: "en-GB", "sy:updatePeriod": "hourly", "sy:updateFrequency": "1", item: [ { title: "42. AFRICAN-AMERICAN CIVIL RIGHTS", link: "https://cvhf.org.uk/podcasts/42-african-american-civil-rights/", "dc:creator": "Philip Ewen", pubDate: "Wed, 10 Mar 2021 05:00:33 +0000", guid: { "@isPermaLink": "false", "#text": "https://cvhf.org.uk/?post_type=podcast&p=20840" }, description: "In this talk to senior school pupils, Dr Gareth Davies explains what ‘Jim Crow’ was, and what sustained it before examining what destabilised and finally destroyed it. He finishes by discussing what replaced ‘Jim Crow’ and shows evidence of progress.", "content:encoded": "<p><span style="font-weight: 400;">In this talk to senior school pupils, Dr Gareth Davies explains what ‘Jim Crow’ was, and what sustained it before examining what destabilised and finally destroyed it. He finishes by discussing what replaced ‘Jim Crow’ and shows evidence of progress.</span></p>" },

icon

Best answer by sourabhramsingh 11 March 2021, 08:01

You’ve mentioned feeds.PODCASTS.rss.chanel.item in your query. 

Please change it to feeds.PODCASTS.rss.channel.item

There could be other issues to that as well, but try changing that first. 

View original

5 replies

Badge

You’ve mentioned feeds.PODCASTS.rss.chanel.item in your query. 

Please change it to feeds.PODCASTS.rss.channel.item

There could be other issues to that as well, but try changing that first. 

Badge

Thank you - that fixed it. Darned typos! Thank you very much indeed.

Is there a resource that I can understand the structure of the data source syntax? The original help guide was talking about feeds.PODCASTS.item and it was only by chance I found someone mentioning the additional ‘rss.channel’ to make it feeds.PODCASTS.rss.channel.item

Thank you very much for your help.

 

 

Userlevel 4
Badge +4

Hi @fillyouin ! That’s a great question. feeds.PODCASTS gets you to the feed itself, and from there, the data structure is based on what your feed contains. Adding .rss gets you into the rss heading, and .channel gets you into the channel subheading. .item is added at the end as the placeholder you’ll use within the block (it’s where the “item” in {{ item.title }} comes from). 

 

I hope that helps clarify a bit! 

Userlevel 6
Badge +4

Just to chime in here, you can also click on the “Preview” button in your Data Feed to see an example set of data it pulls.  Here, you should get a quick glance of what data would be available to use in your Templates.

See here:

Here’s some Klaviyo Documentation to help you navigate:

Badge

Thank you all that is really helpful. Much appreciated.

Reply