Skip to main content

Variables in notification templates

The emails and SMS messages Riseact sends (thank-you messages, receipts, payment links, instructions) are templates where variables go between double curly braces. When the message is sent, each variable is replaced with the real data:

Hi {{ supporter.first_name }}, thank you for your donation of {{ donation.amount }} euros.

Templates use the Jinja syntax: besides variables, they can use conditions and filters.

Two syntaxes, both valid​

Variables come in two forms:

VersionExampleUse
Unified (v2){{ supporter.first_name }}Recommended syntax, used by the editor and by the default templates.
Legacy (v1){{ supporter_first_name }}Historical syntax, still found in many saved templates.

Every notification always receives both forms, so a template keeps working whichever syntax it is written in, even when it mixes them. New templates should use the unified version only: it is the one the editor offers and the one existing templates will be converted to.

A variable that does not exist renders as an empty string, with no error: when some data is missing from an email, check the variable name first.

Available variables​

Always available​

VariableContent
date.todayToday's date, dd/mm/yyyy
date.current_yearCurrent year
date.previous_yearPrevious year
organization.nameOrganization name
organization.legal_nameLegal name
organization.emailContact email
organization.phoneContact phone
organization.websiteWebsite
organization.logo_urlLogo URL
organization.address, organization.address_2Address
organization.city, organization.state, organization.postal_code, organization.countryCity, state, postal code, country
organization.vatVAT number
organization.tax_idTax code

Supporter​

Available in every notification addressed to a supporter.

VariableContent
supporter.first_name, supporter.last_name, supporter.full_nameFirst name, last name, full name
supporter.business_nameBusiness name, for company supporters
supporter.email, supporter.phone, supporter.mobileContacts
supporter.address, supporter.address_2, supporter.city, supporter.locality, supporter.postal_code, supporter.countryAddress
supporter.ssnTax code
supporter.vatVAT number
supporter.typeSupporter type
supporter.certificate_urlLink to the donation certificate

Donation​

Available in notifications about a donation that already exists.

VariableContent
donation.codeDonation code
donation.amountAmount
donation.dateCreation date
donation.frequencyFrequency (one-off, monthly, ...)
donation.campaignCampaign name
donation.payment_methodPayment method
donation.stateState
donation.receipt_urlLink to the receipt
donation.fundraiser_nameFundraiser name, for donations to a peer-to-peer fundraiser (empty otherwise)
donation.last_payment_dateDate of the last payment, present only when the donation has at least one

Checkout​

Available in notifications about a donation that is not completed yet.

VariableContent
checkout.urlLink to complete the donation
checkout.amountAmount
checkout.dateCreation date
checkout.frequencyFrequency
checkout.campaignCampaign name
checkout.payment_methodChosen payment method
checkout.payment_instructionsInstructions of the manual payment method
checkout.fundraiser_nameFundraiser name (empty when there is none)

Payment instructions can span several lines: to keep the line breaks in an email use the linebreaksbr filter, {{ checkout.payment_instructions|linebreaksbr }}.

Campaign​

Available in the "Lead Confirmation" notification, sent to whoever leaves their details on a lead campaign. A lead has no donation: the donation.* variables stay empty.

VariableContent
campaign.titleCampaign name
campaign.urlLink to the campaign page, or to the peer-to-peer page when the lead comes from one

Other variables​

VariableContent
authentication.urlLogin link to the supporter area, only in the "Supporter Login" notification
staff.nameName of the staff member, only when the message is triggered by a staff action in the back-office
customfields['key']Value of a supporter or donation custom field, see Custom Fields

Variables per notification​

Organization and date are always present. The rest depends on the notification:

NotificationSupporterDonationCheckoutCampaign
Donation Received (and the campaign thank-you email)yesyesnono
Donation Refundedyesyesnono
Donation Abandonedyesnoyesno
Donation Instructionsyesnoyesno
Checkout Send Linkyesnoyesno
Tax Certificateyesnonono
Lead Confirmation (and the lead campaign confirmation email)yesnonoyes
Supporter Loginnononono

A variable from a group that is not available renders empty: for example {{ donation.amount }} in the "Donation Abandoned" notification stays empty, there the amount is {{ checkout.amount }}.

Conditions​

To show some text only when a value is present:

{% if supporter.first_name %}Hi {{ supporter.first_name }},{% else %}Hi,{% endif %}

Mapping from the legacy syntax​

To read or update a template written with the legacy names:

Legacy (v1)Unified (v2)
current_year, last_year, today_datedate.current_year, date.previous_year, date.today
organization_name, organization_email, ...organization.name, organization.email, ...
organization_ssnorganization.tax_id
supporter_first_name, supporter_last_name, ...supporter.first_name, supporter.last_name, ...
first_name, last_namesupporter.first_name, supporter.last_name
supporter_name, supporter_full_namesupporter.full_name
donation_amount, donation_date, ... in donation notificationsdonation.amount, donation.date, ...
donation_amount, donation_date, ... in checkout notificationscheckout.amount, checkout.date, ...
donation_receipt_urldonation.receipt_url
donation_last_payment_datedonation.last_payment_date
donation_urlcheckout.url
payment_method_instructionscheckout.payment_instructions
fundraiser_namedonation.fundraiser_name or checkout.fundraiser_name
staff_namestaff.name
authentication_urlauthentication.url
customfield_keycustomfields['key']
campaign_title, campaign_urlcampaign.title, campaign.url