Private
Public Access
1
0

adding athlete last name to alert

This commit is contained in:
Sander Roosendaal
2022-09-16 16:19:01 +02:00
parent 961d4d9ab2
commit c7f1306df1
4 changed files with 20 additions and 3 deletions

View File

@@ -980,6 +980,13 @@ def checkbreakthrough(w, r):
r.user.first_name, r.user.first_name,
r.user.last_name, r.user.last_name,
btvalues=btvalues.to_json()) btvalues=btvalues.to_json())
for coach in r.get_coaches():
_ = myqueue(queuehigh, handle_sendemail_breakthrough,
w.id,
coach.user.email,
r.user.first_name,
r.user.last_name,
btvalues=btvalues.to_json())
# submit email task to send email about breakthrough workout # submit email task to send email about breakthrough workout
if ishard: # pragma: no cover if ishard: # pragma: no cover
@@ -993,6 +1000,13 @@ def checkbreakthrough(w, r):
r.user.first_name, r.user.first_name,
r.user.last_name, r.user.last_name,
btvalues=btvalues.to_json()) btvalues=btvalues.to_json())
for coach in r.get_coaches():
_ = myqueue(queuehigh, handle_sendemail_hard,
w.id,
coach.user.email,
r.user.first_name,
r.user.last_name,
btvalues=btvalues.to_json())
return isbreakthrough, ishard return isbreakthrough, ishard

View File

@@ -52,6 +52,7 @@ class Command(BaseCommand):
alert.manager.first_name, alert.manager.first_name,
alert.manager.last_name, alert.manager.last_name,
alert.rower.user.first_name, alert.rower.user.first_name,
alert.rower.user.last_name,
alert.name, alert.name,
stats, debug=True, stats, debug=True,
othertexts=othertexts) othertexts=othertexts)

View File

@@ -1304,7 +1304,8 @@ def sigdig(value, digits=3):
@app.task @app.task
def handle_send_email_alert( def handle_send_email_alert(
useremail, userfirstname, userlastname, rowerfirstname, alertname, stats, **kwargs): useremail, userfirstname, userlastname, rowerfirstname, rowerlastname,
alertname, stats, **kwargs):
if 'othertexts' in kwargs: # pragma: no cover if 'othertexts' in kwargs: # pragma: no cover
othertexts = kwargs['othertexts'] othertexts = kwargs['othertexts']
@@ -1356,6 +1357,7 @@ def handle_send_email_alert(
'enddate': stats['enddate'], 'enddate': stats['enddate'],
'siteurl': siteurl, 'siteurl': siteurl,
'rowerfirstname': rowerfirstname, 'rowerfirstname': rowerfirstname,
'rowerlastname': rowerlastname,
'alertname': alertname, 'alertname': alertname,
'othertexts': othertexts, 'othertexts': othertexts,
} }

View File

@@ -4,7 +4,8 @@
<p>Dear <strong>{{ first_name }}</strong>,</p> <p>Dear <strong>{{ first_name }}</strong>,</p>
<p> <p>
Here is the report for your alert <strong>{{ alertname }}</strong> on <a href="{{ siteurl }}">rowsandall.com</a>. This is a report for your athlete {{ rowerfirstname }}, covering the period from Here is the report for your alert <strong>{{ alertname }}</strong> on <a href="{{ siteurl }}">rowsandall.com</a>.
This is a report for your athlete {{ rowerfirstname }} {{ rowerlastname }}, covering the period from
{{ startdate }} to {{ enddate }}. {{ startdate }} to {{ enddate }}.
</p> </p>
@@ -24,4 +25,3 @@
Best Regards, the Rowsandall Team Best Regards, the Rowsandall Team
</p> </p>
{% endblock %} {% endblock %}