mail processing confirmation uses template
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user