Private
Public Access
1
0

new user sample data

This commit is contained in:
Sander Roosendaal
2017-06-16 08:46:13 +02:00
parent 252be03e47
commit b0d6430e5b
3 changed files with 50 additions and 1 deletions

View File

@@ -47,6 +47,42 @@ def handle_new_workout_from_file(r,f2,
return new_workout_from_file(r,f2,workouttype,
title,makeprivate,notes)
# send email when a breakthrough workout is uploaded
@app.task
def handle_sendemail_breakthrough(workoutid,useremail,userfirstname,userlastname):
# send email with attachment
subject = "A breakthrough workout on rowsandall.com"
message = "Dear "+userfirstname+",\n"
message += "Congratulations! Your recent workout has been analyzed"
message += " by Rowsandall.com and it appears your fitness,"
message += " as measured by Critical Power, has improved!"
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 += " [link to article to be written]\n\n"
message += "Link to the workout http://rowsandall.com/rowers/workout/"
message += str(workoutid)
message +="/edit\n\n"
message +="To add the workout to your Ranking workouts and see the updated CP plot, click the following link:\n"
message += "http://rowsandall.com/rowers/workout/"
message += str(workoutid)
message += "/updatecp\n\n"
message += "Best Regards, the Rowsandall Team"
email = EmailMessage(subject, message,
'Rowsandall <info@rowsandall.com>',
[useremail])
res = email.send()
# remove tcx file
os.remove(unrecognizedfile)
return 1
# send email to me when an unrecognized file is uploaded
@app.task
def handle_sendemail_unrecognized(unrecognizedfile,useremail):