From 29f5fa744c1fff8d114f2d74a52293fae2b7fed7 Mon Sep 17 00:00:00 2001 From: Kevin Owocki Date: Tue, 30 Nov 2021 10:07:37 -0700 Subject: [PATCH] txn history in 12h email (#9774) --- app/retail/emails.py | 3 +- .../emails/grants/new_contributions.html | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/app/retail/emails.py b/app/retail/emails.py index 6cf971f1b50..ff266fff334 100644 --- a/app/retail/emails.py +++ b/app/retail/emails.py @@ -149,11 +149,12 @@ def render_new_contributions_email(grant): 'show_polygon_amount': False if amount_raised_polygon < 1 else True, 'num_of_contributors': num_of_contributors, 'media_url': settings.MEDIA_URL, + 'contributions': contributions, 'utm_tracking': build_utm_tracking('new_contributions'), } response_html = premailer_transform(render_to_string("emails/grants/new_contributions.html", params)) response_txt = render_to_string("emails/grants/new_contributions.txt", params) - subject = _("You have new Grant contributions!") + subject = f"You have {contributions.count()} new Grant contributions worth ${round(amount_raised, 2)}!" if amount_raised < 1: # trigger to prevent email sending for negligible amounts diff --git a/app/retail/templates/emails/grants/new_contributions.html b/app/retail/templates/emails/grants/new_contributions.html index 2a7c8ef4251..d86858fbdd8 100644 --- a/app/retail/templates/emails/grants/new_contributions.html +++ b/app/retail/templates/emails/grants/new_contributions.html @@ -87,6 +87,18 @@ margin-top: 0 !important; } } + #transaction_history{ + margin: 0px auto; + } + #transaction_history tr{ + margin-left: 10px; + } + #transaction_history td{ + padding: 10px; + } + #transaction_history tr.row td{ + border-top: 1px solid #777; + }
@@ -127,6 +139,29 @@

New Cont Grants Page

+
+

The {{contributions.count}} Contributions:

+ + {% for contribution in contributions %} + {% with subscription=contribution.subscription %} + + + + + + + {% endwith %} + {% endfor %} +
+ {{contribution.created_on|naturaltime}} + + + {{subscription.contributor_profile.handle}} + + {{subscription.amount_per_period|floatformat:4}} {{subscription.token_symbol}} + + view >> +
{% endblock %}