Skip to content
Snippets Groups Projects
Commit 2f52b327 authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Add variable to pass SMTP server credentials

parent ce91cc8a
No related branches found
No related tags found
No related merge requests found
......@@ -49,9 +49,10 @@ def create_app(config=None):
# Send ERROR via mail
from logging.handlers import SMTPHandler
mail_handler = SMTPHandler(app.config['MAIL_SERVER'],
app.config['EMAIL_SENDER'],
app.config['ADMIN_EMAILS'],
'Inventory: ERROR raised')
fromaddr=app.config['EMAIL_SENDER'],
toaddrs=app.config['ADMIN_EMAILS'],
subject='Inventory: ERROR raised',
credentials=app.config['MAIL_CREDENTIALS'])
mail_handler.setFormatter(logging.Formatter("""
Message type: %(levelname)s
Location: %(pathname)s:%(lineno)d
......
......@@ -18,8 +18,9 @@ BOOTSTRAP_SERVE_LOCAL = True
SECRET_KEY = (os.environ.get('SECRET_KEY') or
b'\x0d\x11{\xd3\x13$\xeeel\xa6\xfb\x1d~\xfd\xb2\x9d\x16\x00\xfb5\xd64\xd4\xe0')
MAIL_SERVER = 'mail.esss.lu.se'
MAIL_CREDENTIALS = None
ADMIN_EMAILS = ['admin@example.com']
EMAIL_SENDER = 'inventory@esss.se'
EMAIL_SENDER = 'noreply@esss.se'
JWT_ACCESS_TOKEN_EXPIRES = timedelta(hours=12)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment