Using Email to Maximize Donations - cStreet Campaigns

Using Email to Maximize Donations

Each year millions of dollars are left on the table from supporters who don't maximize their contributions. Many of them don't know how much they're allowed to donate, or forget to top it up at the end of the year. We’ve solved that by creating a way to send email blasts customized to each person’s donation history and limits, along with a one-click solution to help them donate.

To make this all work, we have to start at the end. The final step of this process requires your Donation pages to support a hack my colleague built last year. Visit this blog post for details on how to setup the auto-populating donation amounts on your Donation pages. Come back to this post when you’re done. We’ll be right here waiting.

 

Welcome back! Now that your Donation pages are setup, let's get into the email part. The following code adds up all of a supporters donations for this calendar year, and subtracts it from the annual donation limit, leaving them with the remaining value, and a link to auto-fill the Donation page with that amount. Let's go through it step-by-step.

 

1. This line is where you'll set your donation limit. The value must be in cents!

{% capture maximum_annual_donation_cents %}100000{% endcapture %}

2. This is the real brains of the code, where the donations are all added up. You don't need to change anything here.

{% capture current_year %}{{ 'now' | date: "%Y" }}{% endcapture %}
{% assign current_year = current_year | plus: 0 %}
{% assign donated_amount = 0 %}
{% for donation in recipient.donations %}
  {% capture donation_year %}{{ donation.succeeded_at | date: "%Y" }}{% endcapture %}
  {% assign donation_year = donation_year | plus: 0 %}
  {% if donation_year == current_year %}
    {% assign donated_amount = donated_amount | plus: donation.amount_in_cents %}
  {% endif %}
{% endfor %}

3. This section is subtracting the donated amount from the donation limit, and saving the remaining value.

{% assign remaining_donation = maximum_annual_donation_cents | minus: donated_amount | divided_by: 100 %}

 

4. And here's the custom URL that will be used to create a link to your Donation page. Make sure you replace my Nation's URL with your own!

{% assign donation_url = "https://[your-slug].nationbuilder.com/" | append: "donate?amount=" | append: remaining_donation %}

 

5. This part is where you can get creative. I've written some copy for you, but you can edit it however you'd like. Just make sure you keep the Liquid parts (that's the stuff between the curly brackets) intact. You can move them around within the copy though.

You've donated ${{ donated_amount | divided_by: 100 }} this year, and you're allowed to donate up to ${{ maximum_annual_donation_cents | divided_by: 100 }}. Help us continue our mission by donating the remaining ${{ remaining_donation }} today.

 

6. And finally, this is the link to your auto-populating Donation page. You can also change the copy of this part if you'd like.

<a href="{{donation_url}}" target="_blank">Click Here to Donate ${{ remaining_donation }}

 

That's all it takes! Let me know in the comments if you've used this, or if you have any other tips on how to maximize donations.

originally published Friday, October 20, 2017