Private
Public Access
1
0

works but runs into email rate limiting

This commit is contained in:
Sander Roosendaal
2017-04-14 08:57:46 +02:00
parent 34b5d420ee
commit 5bc69b3a49
5 changed files with 352 additions and 11 deletions

View File

@@ -21,7 +21,7 @@ import stravalib
from utils import serialize_list,deserialize_list
from rowers.dataprepnodjango import update_strokedata
from rowers.dataprepnodjango import new_workout_from_file
from django.core.mail import send_mail, BadHeaderError,EmailMessage
@@ -30,6 +30,16 @@ from django.core.mail import send_mail, BadHeaderError,EmailMessage
def add(x, y):
return x + y
# create workout
@app.task
def handle_new_workout_from_file(r,f2,
workouttype='rower',
title='Workout',
makeprivate=False,
notes=''):
return new_workout_from_file(r,f2,workouttype,
title,makeprivate,notes)
# send email to me when an unrecognized file is uploaded
@app.task
def handle_sendemail_unrecognized(unrecognizedfile,useremail):
@@ -80,6 +90,16 @@ def handle_sendemailtcx(first_name,last_name,email,tcxfile):
os.remove(tcxfile)
return 1
@app.task
def handle_zip_file(emailfrom,subject,file):
message = "... zip processing ... "
email = EmailMessage(subject,message,
emailfrom,
['workouts@rowsandall.com'])
email.attach_file(file)
res = email.send()
return 1
# Send email with CSV attachment
@app.task
def handle_sendemailcsv(first_name,last_name,email,csvfile):