Private
Public Access
1
0

cp data sending to admin

This commit is contained in:
Sander Roosendaal
2018-08-28 11:59:18 +02:00
parent 18b8f96418
commit 4f5695723b
4 changed files with 121 additions and 0 deletions

View File

@@ -977,6 +977,39 @@ def handle_sendemailcsv(first_name, last_name, email, csvfile,**kwargs):
return 1
@app.task
def handle_sendemailfile(first_name, last_name, email, csvfile,**kwargs):
# send email with attachment
fullemail = first_name + " " + last_name + " " + "<" + email + ">"
subject = "File from Rowsandall.com"
d = {'first_name':first_name,
'siteurl':siteurl,
}
from_email = 'Rowsandall <info@rowsandall.com>'
res = send_template_email(from_email,[fullemail],
subject,'fileemail.html',d,
attach_file=csvfile,**kwargs)
if 'delete' in kwargs:
dodelete = kwargs['delete']
else:
dodelete = False
if dodelete:
try:
os.remove(csvfile)
except:
pass
return 1
# Calculate wind and stream corrections for OTW rowing