Advanced Merge Fields
Default email merge fields are great at pulling supporter information into your messages. But what if you need to change the message based on the information you pull in — to include a tax-deductible disclaimer on receipts for donations made in your currency but hide the disclaimer on receipts for foreign contributions, for example. Or what if you want to tell donors the impact of their donation by multiplying the donation amount by the number of meals each dollar will provide. Are all of these possible?
Absolutely! All email and SMS templates in Raisely have access to conditional logic and template helpers, and you can use these to evaluate and manipulate data using certain conditions.
Some recent updates have been made as part of Raisely's commitment to protecting donor privacy so some PURLs and Advanced Merge Fields that you may have been familiar with previously would need to be adjusted. You can read more about the our security commitment here.
Conditional Logic
Conditional logic lets you show or hide content based on supporter or donation information. If a condition is met, the content will appear. If a condition isn't met, the content will stay hidden.
Add Conditions to Your Messages
Conditions are kind of like a sandwich: they're made by squishing your juicy content between two or three merge fields. Every condition starts with {{#yourCondition}} and ends with {{/yourCondition}} , like this example below:
{{#lt profile.totalPercent 90}}You're almost there - ask your friends to donate today!{{/lt}}
You can also use {{else}} between the opening and closing merge fields to add backup content in case the condition isn't met. If you wanted to be extra thankful to donors who give generously, for example, you could add the following to your donation receipt:
{{#gte donation.amount 500}}Thank you SO much for your generous donation!{{else}}Thanks for your support!{{/gte}}
If the donor gives $500 or more to your campaign, they will see "Thank you SO much for your generous donation!" in their receipt. If the donor gives less than $500, they will simply see "Thanks for your support!".
Add Conditions to Your Pages
You can add conditions to your pages so that content changes dynamically based on the donor's session or specific parameters in your PURLs (Personalized URLs).
Following our security updates, personal data (like names) is now handled via secure sessions, while non-personal data (like campaign sources) continues to use URL queries.
1. Conditional Content based on Personal Data (User Session)
To greet a donor by name, you no longer pull data directly from the URL. Instead, you use the user object. This works when a donor arrives via a link containing an access_token (automatically generated in the Raisely email editor).
Example Scenario: You want to show a personalized greeting if the donor is recognized, or a general message if they are a new visitor.
Example PURL: https://campaignsite.com/?access_token={{user.accessToken}}
Use this conditional statement on your page to display their name if available:
{{#if user.firstName}}Hey {{user.firstName}}, thanks for being a great supporter of the campaign!{{else}}Thanks for being a great supporter of our mission!{{/if}}
2. Conditional Content based on Query Parameters (PURLs)
For data that isn't personally identifiable—such as a specific donor segment, tracking code, or campaign type—you can still use standard query parameters in your URL.
Example PURL: https://campaignsite.com/?donorType=regular
Use this conditional statement to change the message based on that "donorType" value:
{{#eq query.donorType 'regular'}} As a regular supporter, you help to ensure consistent funding for important programs. {{else eq query.donorType 'major'}} As a generous supporter, you help us shift the needle with making a real impact on these issues. {{else eq query.donorType 'xyz'}} As a xyz supporter, you help us ensure.....{{else}} Help us ensure that.... {{/eq}}
This allows you to create highly tailored landing page experiences while keeping your donors' personal information secure and compliant.
Available Conditions
These are all the conditions you can use in messages. X is the data field you want to evaluate, and Y is the field (or value) you want to evaluate against:
Condition |
Definition |
Example |
{{#if X}}
{{/if}} |
X ✅ X is true or exists |
{{#if donation.public.customCheckbox}}
Thanks for ticking this box! {{/if}} If the donor ticked a custom checkbox field, this sentence will show. |
{{#eq X Y}}
{{/eq}} |
X = Y X is equal to Y |
Thanks for your generous support!
Sincerely, Global Cause {{#eq donation.currency 'AUD'}} ABN 12345 {{/eq}} {{#eq donation.currency 'USD'}} EIN 12-345 {{/eq}} If the donation's currency is AUD, the receipt will show the organisation's ABN. If the donation's currency is USD, the receipt will show the organisation's EIN. ❓ What if the donation's currency isn't AUD or USD?
|
{{#gt X Y}}
{{/gt}} |
X > Y X is greater than Y |
{{#gt donation.amount 499}}
Thank you SO much for your extra-generous donation! {{/gt}} If the donation is $500 or more, this sentence will show. |
{{#gte X Y}}
{{/gte}} |
X >= Y X is greater than or equal to Y |
{{#gte profile.total profile.goal}}
Massive congratulations, you've reached your fundraising goal! 🙌 {{/gte}} If the fundraiser has met or exceeded their fundraising goal, this sentence will show. 🚀 Pro tip: use 'greater than or equal to' instead of just 'equal to' because it's highly unlikely a fundraiser will raise the exact amount of their goal — they'll probably raise a few dollars more! |
{{#lt X Y}}
{{/lt}} |
X < Y X is less than Y |
{{#lt profile.totalPercent 50}}
You're nearly halfway to your goal! Ask your friends to donate today! {{/lt}} If a fundraising profile's total is less than 50% of their goal, this sentence will show. |
{{#lte X Y}}
{{/lte}} |
X <= Y X is less than or equal to Y |
{{#lte profile.totalPercent 10}}
You're off to a great start! Share your profile on social media to help get the word out there 🗣 {{/lte}} If a fundraising profile's total is less than or equal to 10% of their goal, this sentence will show. |
Template Helpers
Template helpers let you format and manipulate information in your messages, and they're most commonly used with donation amounts, profile totals, and dates.
Add Template Helpers to Your Messages
While conditional logic needs two merge fields to work, template helpers only use one merge field: the helper itself. Add any of the merge fields listed below to your message, and the merge field will automatically be replaced with the correctly-formatted or -calculated data when the supporter reads their message.
Available Template Helpers
These are all the helpers you can use in messages. X is the first data field you want to evaluate, and Y is the second field (or value) you want to evaluate:
Helper |
Definition |
Example |
{{money [amount] currency='code'}} |
Shows a currency amount with the symbol for the currency specified. 🚀 Pro tip: add |
You donated {{money donation.amount currency=donation.currency}}!
You donated £25.00! You donated {{money donation.amount currency='GBP' hideCents=1}}! You donated £25! |
{{number X}} |
Formats large numbers with commas to make the numbers easier to read. {{profile.exerciseTotal}}: 489000{{number profile.exerciseTotal}}: 489,000 |
You have biked {{number profile.exerciseTotal}} metres to date!
You have biked 489,000 metres to date! |
{{ordinal X}} |
Converts number into ordinal form. {{profile.total}}: 100
|
You just earned your {{ordinal profile.total}} dollar!
You just earned your one hundredth dollar! |
{{ordinal X true}} |
Converts number into numeric ordinal form. {{profile.total}}: 100
|
You just earned your {{ordinal profile.total true}} dollar!
You just earned your 100th dollar! |
{{add X Y}} |
Inserts the value of X + Y |
You reached your goal of ${{profile.goal}}! Shoot for the stars — increase your goal to $ {{add profile.goal 100}} today!
You reached your goal of $500! Shoot for the stars — increase your goal to $600 today! |
{{subtract X Y}} |
Inserts the value of X - Y |
You only have $ {{subtract profile.goal profile.total}} to raise in order to hit your goal! You can do it!
You only have $45.61 to raise in order to hit your goal! You can do it! |
{{multiply X Y}} |
Inserts the value of X · Y |
Because you gave during our matched giving week, your ${{donation.amount}} donation is now worth $ {{multiply donation.amount 2}}!
Because you gave during our matched giving week, your $25.00 donation is now worth $50.00! |
{{divide X Y}} |
Inserts the value of X ➗ Y |
Every dollar we receive lets us give a warm meal to 4 people in need. Your generous {{money donation.amount currency=donation.currency hideCents=1}} donation just fed {{divide donation.amount 0.25}} people!
Every dollar we receive lets us give a warm meal to 4 people in need. Your generous $25 donation just fed 100 people! |
{{percent X}} |
Converts X to a percent |
0.76 is {{percent 0.76}} of 1.
0.76 is 76% of 1. |
{{percent X Y}} |
Shows X as a percentage of Y |
You've raised {{percent profile.total profile.goal}} of your goal!
You've raised 59% of your goal! |
Formatting Date and Time in messages
Messages in Raisely will default to sending dates in universal time (that's Greenwich Mean Time). If your campaign isn't in the UK, you probably want to customise the timezone your emails use so the dates appear correct to the people who are receiving them. 👍
Your emails currently show dates like: <br>{{prettyDate donation.createdAt}}. This formats them to be human-readable, but won't convert the timezone.
To set a timezone, you need to replace this merge field with:
{{localDate donation.createdAt "Australia/Sydney" "dd/MM/YYYY"}} .
The first section in double-quotes is your timezone, pick one closest to where your donors are. You can find the full list at the bottom of the article in the dropdown menu.
The second section is the format you'd like to display the date in. Common formats are:
- dd/MM/YYYY – displays as 02/11/2021 (British/Australian format)
- MM/dd/YYYY - displays as 11/02/2021 (US format)
You can see here for a full list of formatting options.
Timezones
You can use any of the timezone options available below:
Cannot find the support guide you are after? Head on over to our YouTube channel 📺 for more creative content to help you go further. You can even leave us comments, suggesting new content ideas 🤯