cp data sending to admin
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user