Private
Public Access
1
0

sending alerts in rudimentary form

This commit is contained in:
Sander Roosendaal
2019-08-19 12:55:54 +02:00
parent 5015266ba8
commit 52dff568a2
4 changed files with 121 additions and 8 deletions

View File

@@ -756,6 +756,35 @@ def handle_updatedps(useremail, workoutids, debug=False,**kwargs):
return 1
@app.task
def handle_send_email_alert(
useremail, userfirstname, userlastname, stats, **kwargs):
if 'debug' in kwargs:
debug = kwargs['debug']
else:
debug = False
subject = "Your rowing performance on rowsandall.com ({startdate} to {enddate})".format(
startdate = stats['startdate'],
enddate = stats['enddate'],
)
from_email = 'Rowsandall <info@rowsandall.com>'
d = {
'report':stats,
'first_name':userfirstname,
'last_name':userlastname,
'siteurl':siteurl,
}
res = send_template_email(from_email,[useremail],subject,
'alertemail.html',
d,**kwargs)
return 1
@app.task
def handle_send_email_transaction(
username, useremail, amount, **kwargs):