Private
Public Access
1
0

mail processing confirmation uses template

This commit is contained in:
Sander Roosendaal
2018-03-20 09:43:26 +01:00
parent d39451544a
commit 3cd05e9660
3 changed files with 43 additions and 24 deletions

View File

@@ -33,25 +33,23 @@ queuelow = django_rq.get_queue('low')
queuehigh = django_rq.get_queue('default')
# Sends a confirmation with a link to the workout
from rowers.emails import send_template_email
def send_confirm(user, name, link, options):
""" Send confirmation email to user when email has been processed """
d = {
'first_name':user.first_name,
'name':name,
'link':link,
}
fullemail = user.email
subject = 'Workout added: ' + name
message = 'Dear ' + user.first_name + ',\n\n'
message += "Your workout has been added to Rowsandall.com.\n"
message += "Link to workout: " + link + "\n\n"
message += "Best Regards, the Rowsandall Team"
if options:
message += "\n\n" + str(options)
email = EmailMessage(subject, message,
'Rowsandall <info@rowsandall.com>',
[fullemail])
res = email.send()
subject = 'New Workout Added: '+name
res = send_template_email('Rowsandall <info@rowsandall.com>',
[fullemail],
subject,'confirmemail.html',
d
)
return 1