Private
Public Access
1
0

added announcement for hard workout

This commit is contained in:
Sander Roosendaal
2017-10-10 14:41:23 +02:00
parent 392eff116e
commit 977c8b9a79
5 changed files with 66 additions and 7 deletions

View File

@@ -139,6 +139,40 @@ def handle_sendemail_breakthrough(workoutid,useremail,
# remove tcx file
return 1
# send email when a breakthrough workout is uploaded
@app.task
def handle_sendemail_hard(workoutid,useremail,
userfirstname,userlastname,
btvalues = pd.DataFrame().to_json()):
# send email with attachment
subject = "That was a pretty hard workout on rowsandall.com"
message = "Dear "+userfirstname+",\n"
message += "Congratulations! Your recent workout has been analyzed"
message += " by Rowsandall.com and it appears that it was pretty hard work."
message += " You were working pretty close to your Critical Power\n\n"
message += " Critical Power (CP) is the power that you can "
message += "sustain for a given duration. For more, see this "
message += " article in the analytics blog:\n\n"
message += " http://analytics.rowsandall.com/2017/06/17/how-do-we-calculate-critical-power/ \n\n"
message += "Link to the workout http://rowsandall.com/rowers/workout/"
message += str(workoutid)
message +="/edit\n\n"
message += "To opt out of these email notifications, deselect the checkbox on your Profile page under Account Information.\n\n"
message += "Best Regards, the Rowsandall Team"
email = EmailMessage(subject, message,
'Rowsandall <info@rowsandall.com>',
[useremail])
res = email.send()
# remove tcx file
return 1
# send email to me when an unrecognized file is uploaded
@app.task