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}anditem.{tag}. - Namespaced tags are available as
feed.{namespace}.{tag}anditem.{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
| Variable | Type | Description |
|---|---|---|
feed.title | string | The feed's title. |
feed.description | string | The feed's description. |
feed.link | string | The feed's human-readable site URL. |
feed.url | string | The configured feed URL. |
Item Variables
| Variable | Type | Description |
|---|---|---|
item.title | string | Item title. |
item.description | string | The raw item body. |
item.link | string | Item URL. |
item.guid | string | The unique identifier used for tracking. |
item.pubDate | DateTime | Published date. |
item.author | string|null | Item author, when the feed provides one. |
item.categories | string[] | Item categories or tags. |
item.enclosure | array|null | First attachment found in the item. |
A tag's attributes become sub-keys of the Twig variable:
| Tag | Twig 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.
| Tag | On feed | On item |
|---|---|---|
<itunes:author> | feed.itunes.author | item.itunes.author |
<podcast:foo> | feed.podcast.foo | item.podcast.foo |
<dc:bar> | feed.dc.bar | item.dc.bar |
A tag's attributes become sub-keys of the Twig variable:
| Tag | On feed | On item |
|---|---|---|
<itunes:image href="..."/> | feed.itunes.image.href | item.itunes.image.href |
Here are some of the most common iTunes tags for podcast feeds:
Namespaced Feed Variables
| Variable | Type | Description |
|---|---|---|
feed.itunes.author | string | Show author. |
feed.itunes.summary | string | Show description. |
feed.itunes.type | string | episodic or serial. |
feed.itunes.explicit | string | Explicit-content flag (yes / no). |
feed.itunes.image.href | string | Cover artwork URL. |
feed.itunes.owner.name | string | Owner name. |
feed.itunes.owner.email | string | Owner email. |
feed.itunes.category.text | string | Show category. |
Namespaced Item Variables
| Variable | Type | Description |
|---|---|---|
item.itunes.duration | string | Episode length (e.g. 30:00). |
item.itunes.episode | string | Episode number. |
item.itunes.season | string | Season number. |
item.itunes.episodeType | string | full, trailer, or bonus. |
item.itunes.title | string | Cleaner title (no episode / season prefix). |
item.itunes.subtitle | string | Episode subtitle. |
item.itunes.summary | string | Long episode description. |
item.itunes.explicit | string | Explicit-content flag (yes / no). |
item.itunes.image.href | string | Episode artwork URL. |
item.itunes.author | string | Episode author (does not override item.author). |
Examples
Announce a new post
A new post is up on {{ feed.title }}:
{{ item.title }}
{{ item.link }}Announce a new podcast episode
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
{{ item.title }}
{% if item.pubDate %}
Published {{ item.pubDate|date('M j, Y') }}
{% endif %}
{{ item.link }}Skip items missing a real link
{% 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
{% set who = item.itunes.author ?? item.author ?? 'someone' %}
New from {{ who }}: {{ item.title }}
{{ item.link }}