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.

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!".

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?
Since neither condition has been met, the receipt won't show the ABN or the EIN โ€” the area beneath "Global Cause" will just be blank.

{{#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. 'code' is the amount's three-character currency code.



๐Ÿš€ Pro tip: add hideCents=1 to hide cents on whole-dollar amounts

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
{{ordinal profile.total}}: one hundredth

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
{{ordinal profile.total true}}: 100th

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!

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 ๐Ÿคฏ

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Our Support Team Contact Our Support Team