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:
| Version | Example | Use |
|---|---|---|
| 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
| Variable | Content |
|---|---|
date.today | Today's date, dd/mm/yyyy |
date.current_year | Current year |
date.previous_year | Previous year |
organization.name | Organization name |
organization.legal_name | Legal name |
organization.email | Contact email |
organization.phone | Contact phone |
organization.website | Website |
organization.logo_url | Logo URL |
organization.address, organization.address_2 | Address |
organization.city, organization.state, organization.postal_code, organization.country | City, state, postal code, country |
organization.vat | VAT number |
organization.tax_id | Tax code |
Supporter
Available in every notification addressed to a supporter.
| Variable | Content |
|---|---|
supporter.first_name, supporter.last_name, supporter.full_name | First name, last name, full name |
supporter.business_name | Business name, for company supporters |
supporter.email, supporter.phone, supporter.mobile | Contacts |
supporter.address, supporter.address_2, supporter.city, supporter.locality, supporter.postal_code, supporter.country | Address |
supporter.ssn | Tax code |
supporter.vat | VAT number |
supporter.type | Supporter type |
supporter.certificate_url | Link to the donation certificate |
Donation
Available in notifications about a donation that already exists.
| Variable | Content |
|---|---|
donation.code | Donation code |
donation.amount | Amount |
donation.date | Creation date |
donation.frequency | Frequency (one-off, monthly, ...) |
donation.campaign | Campaign name |
donation.payment_method | Payment method |
donation.state | State |
donation.receipt_url | Link to the receipt |
donation.fundraiser_name | Fundraiser name, for donations to a peer-to-peer fundraiser (empty otherwise) |
donation.last_payment_date | Date 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.
| Variable | Content |
|---|---|
checkout.url | Link to complete the donation |
checkout.amount | Amount |
checkout.date | Creation date |
checkout.frequency | Frequency |
checkout.campaign | Campaign name |
checkout.payment_method | Chosen payment method |
checkout.payment_instructions | Instructions of the manual payment method |
checkout.fundraiser_name | Fundraiser 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.
| Variable | Content |
|---|---|
campaign.title | Campaign name |
campaign.url | Link to the campaign page, or to the peer-to-peer page when the lead comes from one |
Other variables
| Variable | Content |
|---|---|
authentication.url | Login link to the supporter area, only in the "Supporter Login" notification |
staff.name | Name 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:
| Notification | Supporter | Donation | Checkout | Campaign |
|---|---|---|---|---|
| Donation Received (and the campaign thank-you email) | yes | yes | no | no |
| Donation Refunded | yes | yes | no | no |
| Donation Abandoned | yes | no | yes | no |
| Donation Instructions | yes | no | yes | no |
| Checkout Send Link | yes | no | yes | no |
| Tax Certificate | yes | no | no | no |
| Lead Confirmation (and the lead campaign confirmation email) | yes | no | no | yes |
| Supporter Login | no | no | no | no |
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_date | date.current_year, date.previous_year, date.today |
organization_name, organization_email, ... | organization.name, organization.email, ... |
organization_ssn | organization.tax_id |
supporter_first_name, supporter_last_name, ... | supporter.first_name, supporter.last_name, ... |
first_name, last_name | supporter.first_name, supporter.last_name |
supporter_name, supporter_full_name | supporter.full_name |
donation_amount, donation_date, ... in donation notifications | donation.amount, donation.date, ... |
donation_amount, donation_date, ... in checkout notifications | checkout.amount, checkout.date, ... |
donation_receipt_url | donation.receipt_url |
donation_last_payment_date | donation.last_payment_date |
donation_url | checkout.url |
payment_method_instructions | checkout.payment_instructions |
fundraiser_name | donation.fundraiser_name or checkout.fundraiser_name |
staff_name | staff.name |
authentication_url | authentication.url |
customfield_key | customfields['key'] |
campaign_title, campaign_url | campaign.title, campaign.url |