diff --git a/rowers/stravastuff.py b/rowers/stravastuff.py index 605f796f..c14e6817 100644 --- a/rowers/stravastuff.py +++ b/rowers/stravastuff.py @@ -303,7 +303,10 @@ def handle_stravaexport(f2,workoutname,stravatoken,description='', # w = Workout.objects.get(id=workoutid) client = stravalib.Client(access_token=stravatoken) - act = client.upload_activity(f2,'tcx.gz',name=workoutname) + try: + act = client.upload_activity(f2,'tcx.gz',name=workoutname) + except: + return {0,'Strava upload failed'} try: res = act.wait(poll_interval=5.0,timeout=30) message = 'Workout successfully synchronized to Strava' diff --git a/rowers/templates/registeremail.html b/rowers/templates/registeremail.html new file mode 100644 index 00000000..b9ac171c --- /dev/null +++ b/rowers/templates/registeremail.html @@ -0,0 +1,55 @@ +{% extends "emailbase.html" %} + +{% block body %} +
Dear {{ first_name }},
+ ++ Thank you for registering on rowsandall.com. + You can now login using the credentials you provided. + The first thing you should do is go to the + Settings page + and make yourself familiar with the various options + available to personalize your experience on the website. + To get there, use the link in the email or click the button + with your first name on it in the upper right corner of the opening page. +
+ ++ As a minimum to get you started, enter your data in the + Heart Rate Zones and Power Zones sections and your + Functional Threshold Power. + Then check your Account Information to make sure it is + accurate and reflects your preferences. +
+ ++ For additional details on these settings and + the buttons at the bottom of the page, read + the settings tutorial at + http://analytics.rowsandall.com/2017/11/02/rowsandall-settings-page-tutorial/. +
+ +
+ Also check out our instructional videos at + http://rowsandall.com/rowers/videos +
+ ++ This website is a labor of love "by rowers, for rowers". + If you find it to be useful, please help us cover + our hosting costs and gain access to additional functionality + by signing on as a Pro member: + https://rowsandall.com/rowers/promembership +
+ ++ Oh, one more thing. The site is currently in beta and is + developing fast. Bear with us. Don't hesitate to + contact me at info@rowsandall.com if anything is broken + or doesn't seem to work as advertised. +
+ ++ Best Regards, the Rowsandall Team +
+{% endblock %} diff --git a/rowers/views.py b/rowers/views.py index 9a5588a5..c75f965f 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -141,6 +141,8 @@ import pandas as pd import numpy as np import matplotlib.pyplot as plt +from rowers.emails import send_template_email + from pytz import timezone as tz,utc import dateutil import mpld3 @@ -954,23 +956,13 @@ def rower_register_view(request): # Create and send email fullemail = first_name + " " + last_name + " " + "<" + email + ">" subject = "Thank you for registering on rowsandall.com" - message = """ -Thank you for registering on rowsandall.com. You can now login using the credentials you provided. The first thing you should do is go to the Settings page and make yourself familiar with the various options available to personalize your experience on the website. To get there, click the button with your first name on it in the upper right corner of the opening page. + from_address = 'Sander Roosendaal