Skip to content

RSS/JSON Feed Variables

Global Variables

In addition to the variables listed below, Event and People Variables are also available.

When a notification is triggered by an RSS/JSON Feed, all relevant data can be found in feed and item.

  • Standard tags are available as feed.{tag} and item.{tag}.
  • Namespaced tags are available as feed.{namespace}.{tag} and item.{namespace}.{tag}.

⚠️ Feed content is untrusted data!

RSS, Atom, and JSON feed item bodies routinely contain raw HTML. If your message template renders the item.description value with the |raw filter, treat that content as untrusted and sanitize it yourself.

Feed Variables

VariableTypeDescription
feed.titlestringThe feed's title.
feed.descriptionstringThe feed's description.
feed.linkstringThe feed's human-readable site URL.
feed.urlstringThe configured feed URL.

Item Variables

VariableTypeDescription
item.titlestringItem title.
item.descriptionstringThe raw item body.
item.linkstringItem URL.
item.guidstringThe unique identifier used for tracking.
item.pubDateDateTimePublished date.
item.authorstring|nullItem author, when the feed provides one.
item.categoriesstring[]Item categories or tags.
item.enclosurearray|nullFirst attachment found in the item.

A tag's attributes become sub-keys of the Twig variable:

TagTwig variable
<enclosure url="..."/>item.enclosure.url
<enclosure type="..."/>item.enclosure.type
<enclosure length="..."/>item.enclosure.length

Namespaced Variables (e.g. iTunes)

Any <namespace:tag> becomes feed.namespace.tag or item.namespace.tag.

TagOn feedOn item
<itunes:author>feed.itunes.authoritem.itunes.author
<podcast:foo>feed.podcast.fooitem.podcast.foo
<dc:bar>feed.dc.baritem.dc.bar

A tag's attributes become sub-keys of the Twig variable:

TagOn feedOn item
<itunes:image href="..."/>feed.itunes.image.hrefitem.itunes.image.href

Here are some of the most common iTunes tags for podcast feeds:

Namespaced Feed Variables

VariableTypeDescription
feed.itunes.authorstringShow author.
feed.itunes.summarystringShow description.
feed.itunes.typestringepisodic or serial.
feed.itunes.explicitstringExplicit-content flag (yes / no).
feed.itunes.image.hrefstringCover artwork URL.
feed.itunes.owner.namestringOwner name.
feed.itunes.owner.emailstringOwner email.
feed.itunes.category.textstringShow category.

Namespaced Item Variables

VariableTypeDescription
item.itunes.durationstringEpisode length (e.g. 30:00).
item.itunes.episodestringEpisode number.
item.itunes.seasonstringSeason number.
item.itunes.episodeTypestringfull, trailer, or bonus.
item.itunes.titlestringCleaner title (no episode / season prefix).
item.itunes.subtitlestringEpisode subtitle.
item.itunes.summarystringLong episode description.
item.itunes.explicitstringExplicit-content flag (yes / no).
item.itunes.image.hrefstringEpisode artwork URL.
item.itunes.authorstringEpisode author (does not override item.author).

Examples

Announce a new post

twig
A new post is up on {{ feed.title }}:

{{ item.title }}
{{ item.link }}

Announce a new podcast episode

twig
New episode of {{ feed.title }}:

{% if item.itunes.episode %}Episode {{ item.itunes.episode }}: {% endif %}{{ item.title }}
{% if item.itunes.duration %}Length: {{ item.itunes.duration }}{% endif %}

{{ item.link }}

Include the published date

twig
{{ item.title }}

{% if item.pubDate %}
Published {{ item.pubDate|date('M j, Y') }}
{% endif %}

{{ item.link }}

Skip items missing a real link

twig
{% if not item.link starts with 'http' %}
    {% skipMessage 'No real link on this item.' %}
{% endif %}

New on {{ feed.title }}: {{ item.title }} ({{ item.link }})

Prefer the iTunes author, fall back to the standard author

twig
{% set who = item.itunes.author ?? item.author ?? 'someone' %}

New from {{ who }}: {{ item.title }}
{{ item.link }}