Use MAIL_DEFAULT_SENDER as the sender in email notifications
This commit is contained in:
parent
977ae7a809
commit
4189422340
1 changed files with 9 additions and 10 deletions
|
@ -159,13 +159,12 @@ class EmailMethod(NotificationMethod):
|
||||||
if not email:
|
if not email:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
with app.app_context():
|
||||||
msg = Message(event_handler.get_summary(notification_data['event_data'], notification_data),
|
msg = Message(event_handler.get_summary(notification_data['event_data'], notification_data),
|
||||||
sender='support@quay.io',
|
|
||||||
recipients=[email])
|
recipients=[email])
|
||||||
msg.html = event_handler.get_message(notification_data['event_data'], notification_data)
|
msg.html = event_handler.get_message(notification_data['event_data'], notification_data)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with app.app_context():
|
|
||||||
mail.send(msg)
|
mail.send(msg)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.exception('Email was unable to be sent: %s' % ex.message)
|
logger.exception('Email was unable to be sent: %s' % ex.message)
|
||||||
|
|
Reference in a new issue