Using donations data in emails

Movement allows you to incorporate donation data into your emails through special merge tags. This guide explains how to use donation-specific merge tags to create dynamic, personalised content based on your supporters' giving history.

Donation Merge Tags

The following donation merge tags can be inserted anywhere in your email content:

  • {{donations.count}} - Total number of donations the supporter has made
  • {{donations.total}} - Sum of all donations from the supporter (in currency)
  • {{donations.average}} - Average donation amount from the supporter
  • {{donations.highest}} - Highest single donation amount from the supporter
  • {{donations.previous_amount}} - The supporters previous donation amount
  • {{donations.previous_date}} - The supporters previous donation date (in YYYY-MM-DD format)

These tags can be accessed via the 'Merge Tags' button or the '+' icon in any editor within the email builder.

For advanced users, the {{donations.history}} has a history of all the supporters donations, with amount and date properties for each entry.

Basic Usage Examples

Here are some basic ways to incorporate donation data into your emails:

Thank you for your {{donations.count}} contribution(s) to our campaign!

Your total support of {{donations.total}} has made a real difference.

Your average gift of {{donations.average}} helps us plan our work.

Your generous gift of {{donations.highest}} was particularly impactful.

Your recent gift of {{donations.previous_amount}} on {{donations.previous_date}} is already making an impact.

Conditional Logic with Donation Tags

You can use donation merge tags with Liquid's conditional logic to create different content for different donor segments.

Identifying Donors vs Non-Donors

{% if donations.count > 0 %}
  Thank you for being one of our valued donors!
{% else %}
  Consider making your first donation today to support our work.
{% endif %}

Recognising Giving Levels

{% if donations.highest > 100 %}
  Your generous support of {{donations.highest}} shows extraordinary commitment to our cause.
{% elsif donations.highest > 50 %}
  Your gift of {{donations.highest}} has made a significant impact on our work.
{% elsif donations.count > 0 %}
  Every contribution matters, and we're grateful for your support of {{donations.highest}}.
{% else %}
  Your support would make a real difference to our campaign.
{% endif %}

Thanking Recurring Donors

{% if donations.count > 3 %}
  Your consistent support through {{donations.count}} separate contributions demonstrates your commitment to our shared values.
{% elsif donations.count < 2 %}
  We appreciate your first contribution—every gift helps us make a difference!
{% endif %}

Personalising Based on Total Giving

{% if donations.total > 500 %}
  Your incredible total contribution of {{donations.total}} has helped us achieve milestone after milestone.
{% elsif donations.total > 100 %}
  Your total support of {{donations.total}} has been instrumental to our success.
{% elsif donations.total > 0 %}
  Your support totalling {{donations.total}} has helped push our movement forward.
{% endif %}

Personalising Based on Previous Gift

{% if donations.previous_amount > 100 %}
  Your last generous donation of {{donations.previous_amount}} was truly impactful.
{% elsif donations.previous_amount > 0 %}
  Thank you for your recent contribution of {{donations.previous_amount}}!
{% endif %}

Personalising Based on Most Recent Donation Date

{% if donations.previous_date and donations.previous_date >= "2025-01-01" %}
  Thanks for supporting our new goals for this year!
{% elsif donations.previous_date and donations.previous_date < "2025-01-01" %}
  It's been a while since your last donation of {{donations.previous_amount}}. Would you consider supporting our new goals for this year?
{% endif %}
{% if donations.previous_date == "" or donations.previous_date < "2025-01-01" %}
  You haven't donated this year. Would you consider supporting our new goals for the year?
{% endif %}

Using Donation History

{% if donations.count > 0 %}
  You first donated on {{ donations.history | sort: "date" | map: "date" | first }}. Thanks for your continued support!
{% endif %}
{% assign donation_dates = donations.history | map: "date" %}
{% for date in donation_dates %}
  {% if date < '2023-01-01' %}
    {% assign donated_before_2023 = true %}
  {% endif %}
{% endfor %}

{% if donated_before_2023 %}
 You've been a donor for more than 2 years!
{%endif %}
{% assign donation_dates = donations.history | map: "date" %}
{% for date in donation_dates %}
  {% if date < '2023-01-01' %}
    {% assign donated_before_2023 = true %}
  {% endif %}
{% endfor %}

{% unless donated_before %}
 You started donating after 2022.
{%endif %}
{% assign donation_dates = donations.history | map: "date" %}
{% for date in donation_dates %}
  {% if date >= '2024-06-01' and date < '2024-07-01' %}
    {% assign donated_in_fundraiser = true %}
  {% endif %}
{% endfor %}

{% if donated_in_fundraiser %}
  You donated during last years June fundraiser, would you consider donating again this year?
{% else %}
  Our June fundraiser is off to a great start, would you consider donating?
{% endif %}
{% assign donation_dates = donations.history | map: "date" %}
{% for date in donation_dates %}
  {% if item.date >= '2024-01-01' and item.date < '2025-01-01' %}
    {% assign donated_in_2024 = true %}
  {% endif %}
{% endfor %}

{% unless donated_in_2024 %}
  You didn't donate in 2024, but how about this year?
{% endunless %}

Assessing Regular Donations

{% assign regular_donor = donations.regular_donations | has: "status", "active" %}
{% if regular_donor == true %}
  You regularly donate
{% else %}
  You do not have any active regular donations.
{% endif %}
{% assign regular_donor = donations.regular_donations | has: "status", "active" %}
{% assign cancelled_regular_donor = donations.regular_donations | has: "status", "cancelled" %}
{% if cancelled_regular_donor == true and regular_donor == false %}
  You used to be a regular donor, would you consider resubscribing?
{% endif %}

Complex Condition Examples

You can combine multiple conditions for more targeted messaging:

{% if donations.count > 5 and donations.average > 50 %}
  As one of our most loyal and generous supporters, with {{donations.count}} donations averaging {{donations.average}}, we wanted to share this exclusive update with you.
{% endif %}
{% if donations.highest > 200 or donations.total > 100 %}
  Your extraordinary generosity qualifies you for our Supporter's Club.
{% endif %}

Best Practices

  1. Provide fallbacks: Account for members without donation history:

    {% if donations.count > 0 %}
      Thank you for your support!
    {% else %}
      Join our community of supporters today.
    {% endif %}
  2. Use appropriate formatting: Consider formatting currency values appropriately:

    Your generous donation of £{{donations.highest}} made a tremendous difference.
  3. Test with various profiles: Before sending, test your email with records having different donation histories to ensure your conditional logic works as expected.