diff --git a/backend/email/thank-you-recurring.html b/backend/email/thank-you-recurring.html new file mode 100644 index 0000000..2c8dfe7 --- /dev/null +++ b/backend/email/thank-you-recurring.html @@ -0,0 +1,29 @@ + + +

Dear {name},

+ +

Thank you for your donation to MAYDAY.US. We are grateful for the support to make it possible for us to win back our democracy.

+ +

This is just the beginning. But if we can succeed as we have so far, then by 2016, we will have taken the first critical step to getting our democracy back.

+ +

This email serves as your receipt for setting up your monthly donation of: {total}

+ +

To change or cancel your future donation, please email us at info@mayday.us, letting us know the email address used to set up your monthly donation. +

Thank you again,

+ +

+ --MAYDAY.US
+

+ +

P.S. Here's another really simple way to help -- just share the suggested text below with your Facebook and Twitter following:

+ +

I just supported #MAYDAYUS, a crowdfunded, kickstarted campaign to reclaim our democracy. You can check it out here: http://mayday.us.

+ +

+ ----------------------
+ Paid for by Mayday PAC
+ Not authorized by any candidate or candidate’s committee
+ www.mayday.us +

+ + diff --git a/backend/email/thank-you-recurring.txt b/backend/email/thank-you-recurring.txt new file mode 100644 index 0000000..223e26a --- /dev/null +++ b/backend/email/thank-you-recurring.txt @@ -0,0 +1,22 @@ +Dear {name}: + +Thank you for your donation to MAYDAY.US. We are grateful for the support to make it possible for us to win back our democracy. + +This is just the beginning. But if we can succeed as we have so far, then by 2016, we will have taken the first critical step to getting our democracy back. + +This email serves as your receipt for setting up your monthly donation of: {total} + +To change or cancel your future donation, please email us at info@mayday.us, letting us know the email address used to set up your monthly donation. + +Thank you again, + +--MAYDAY.US + +P.S. Here's another really simple way to help -- just share the suggested text below with your Facebook and Twitter following: + +I just supported #MAYDAYUS, a crowdfunded, kickstarted campaign to reclaim our democracy. You can check it out here: http://mayday.us. + +---------------------- +Paid for by MayDay PAC +Not authorized by any candidate or candidate’s committee +www.mayday.us diff --git a/backend/handlers.py b/backend/handlers.py index abf1cd7..3b1cddf 100644 --- a/backend/handlers.py +++ b/backend/handlers.py @@ -250,9 +250,12 @@ def pledge_helper(handler, data, stripe_customer_id, stripe_charge_id, paypal_pa 'total': totalStr, 'user_url_nonce': user.url_nonce } - - text_body = open('email/thank-you.txt').read().format(**format_kwargs) - html_body = open('email/thank-you.html').read().format(**format_kwargs) + if data['recurring'] == True: + text_body = open('email/thank-you-recurring.txt').read().format(**format_kwargs) + html_body = open('email/thank-you-recurring.html').read().format(**format_kwargs) + else: + text_body = open('email/thank-you.txt').read().format(**format_kwargs) + html_body = open('email/thank-you.html').read().format(**format_kwargs) env.mail_sender.Send(to=data['email'].encode('utf-8'), subject='Thank you for your pledge',