Skip to content

Special Variables

A collection of special variables are automatically set within the message template. Some of these variables are always available, while others depend on the event type which triggered the notification.

They can also be used to determine dynamic recipients, with one notable exception... For obvious reasons, the recipient variable cannot be available while determining the recipient.

Event Type Variables

Available based on which event type triggered the notification.

Event typeVariables
Element Eventsoriginal, object, element, element alias (entry, asset, user, etc.)
RSS/JSON Feedfeed, item
System Snapshotreport
Dynamic Datadata

Event and People Variables

Available to all event types.

Current User Availability

currentUser is only available when the notification was triggered by a real, logged-in user. It won't be available if the notification was triggered via command line or a cron job (since there's no logged-in user in that scenario).

If the message is being sent to multiple recipients, Notifier will loop over each recipient individually. Each recipient will receive a unique copy of the templated message.

The recipient variable will be unique for each recipient, per their copy of the outbound message.

VariableDescription
eventThe underlying triggered Event.
currentUserThe logged-in User who triggered the notification.
recipientIndividual recipient of each message.
recipient.userUser model of recipient.
recipient.nameName of recipient.
recipient.emailAddressEmail address of recipient.
recipient.phoneNumberPhone number of recipient.
recipient.emailFieldField from which the email address was retrieved.
recipient.smsFieldField from which the phone number was retrieved.

Examples

Greet the recipient by name

twig
Hi {{ recipient.name }},

We'll keep you posted at {{ recipient.emailAddress }}.

Identify who triggered the notification

twig
{% if currentUser %}
    {{ currentUser.fullName }} just triggered this notification.
{% else %}
    This notification was triggered by an automated process.
{% endif %}

Skip the message when the recipient is the user who triggered it

twig
{% if currentUser and currentUser.id == recipient.user.id %}
    {% skipMessage "Don't notify the user who triggered the event." %}
{% endif %}