Make the default mail sender use the Flask mail config value

This commit is contained in:
Joseph Schorr 2014-10-10 13:14:33 -04:00
parent adc915a5eb
commit 49f8629566
2 changed files with 4 additions and 6 deletions

View file

@ -55,7 +55,7 @@ class DefaultConfig(object):
MAIL_PORT = 587 MAIL_PORT = 587
MAIL_USERNAME = '' MAIL_USERNAME = ''
MAIL_PASSWORD = '' MAIL_PASSWORD = ''
DEFAULT_MAIL_SENDER = '' MAIL_DEFAULT_SENDER = 'support@quay.io'
MAIL_FAIL_SILENTLY = False MAIL_FAIL_SILENTLY = False
TESTING = True TESTING = True

View file

@ -75,7 +75,7 @@ def send_email(recipient, subject, template_file, parameters):
rendered_html = template_env.get_template(template_file + '.html').render(parameters) rendered_html = template_env.get_template(template_file + '.html').render(parameters)
msg = Message('[%s] %s' % (app_title, subject), sender='support@quay.io', recipients=[recipient]) msg = Message('[%s] %s' % (app_title, subject), recipients=[recipient])
msg.html = rendered_html msg.html = rendered_html
mail.send(msg) mail.send(msg)
@ -135,9 +135,7 @@ def send_org_invite_email(member_name, member_email, orgname, team, adder, code)
def send_invoice_email(email, contents): def send_invoice_email(email, contents):
# Note: This completely generates the contents of the email, so we don't use the # Note: This completely generates the contents of the email, so we don't use the
# normal template here. # normal template here.
msg = Message('Quay.io payment received - Thank you!', msg = Message('Quay.io payment received - Thank you!', recipients=[email])
sender='support@quay.io',
recipients=[email])
msg.html = contents msg.html = contents
mail.send(msg) mail.send(msg)
@ -154,7 +152,7 @@ def send_subscription_change(change_description, customer_id, customer_email, qu
""" """
title = SUBSCRIPTION_CHANGE_TITLE.format(quay_username, change_description) title = SUBSCRIPTION_CHANGE_TITLE.format(quay_username, change_description)
msg = Message(title, sender='support@quay.io', recipients=['stripe@quay.io']) msg = Message(title, recipients=['stripe@quay.io'])
msg.html = SUBSCRIPTION_CHANGE.format(change_description, customer_id, customer_email, msg.html = SUBSCRIPTION_CHANGE.format(change_description, customer_id, customer_email,
quay_username) quay_username)
mail.send(msg) mail.send(msg)