From be231c756363db675a1f40c21a60a727444a8ece Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 27 Sep 2019 12:00:06 +0200 Subject: [PATCH] added data to email body (alerts) --- rowers/tasks.py | 3 +++ rowers/templates/alertemail.html | 3 ++- rowers/templates/imports.html | 4 ++-- rowers/templates/rower_exportsettings.html | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rowers/tasks.py b/rowers/tasks.py index 617a3de9..4d22d545 100644 --- a/rowers/tasks.py +++ b/rowers/tasks.py @@ -809,6 +809,7 @@ def handle_send_email_alert( except KeyError: pass + try: report['Median'] = sigdig(stats['median']) except KeyError: @@ -831,6 +832,8 @@ def handle_send_email_alert( 'report':report, 'first_name':userfirstname, 'last_name':userlastname, + 'startdate':stats['startdate'], + 'enddate':stats['enddate'], 'siteurl':siteurl, 'rowerfirstname':rowerfirstname, 'alertname':alertname, diff --git a/rowers/templates/alertemail.html b/rowers/templates/alertemail.html index d94263dd..1d737ccc 100644 --- a/rowers/templates/alertemail.html +++ b/rowers/templates/alertemail.html @@ -4,7 +4,8 @@

Dear {{ first_name }},

- Here is the report for your alert {{ alertname }} on rowsandall.com. This is a report for your athlete {{ rowerfirstname }}. + Here is the report for your alert {{ alertname }} on rowsandall.com. This is a report for your athlete {{ rowerfirstname }}, covering the period from + {{ startdate }} to {{ enddate }}.

{% for text in othertexts %} diff --git a/rowers/templates/imports.html b/rowers/templates/imports.html index ceb31260..f2bd719a 100644 --- a/rowers/templates/imports.html +++ b/rowers/templates/imports.html @@ -123,8 +123,8 @@ {{ form.as_table }} {% csrf_token %} -
- +
+
diff --git a/rowers/templates/rower_exportsettings.html b/rowers/templates/rower_exportsettings.html index 5138566c..7654abcf 100644 --- a/rowers/templates/rower_exportsettings.html +++ b/rowers/templates/rower_exportsettings.html @@ -20,7 +20,7 @@ The auto import and export settings only work on a {{ form.as_table }} {% csrf_token %} - +

Click on one of the icons below to connect to the service of your