diff --git a/README.md b/README.md index a0c82d63..f8c5429a 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,22 @@ projects for all of the test users: `pipenv run python script/seed_sample.py` +### Email Notifications + +To send email, the following configuration values must be set: + +``` +MAIL_SERVER = +MAIL_PORT = +MAIL_SENDER = +MAIL_PASSWORD = +MAIL_TLS = +``` + +When the `DEBUG` environment variable is enabled and the app environment is not +set to production, sent email messages are available at the `/messages` endpoint. +Emails are not sent in development and test modes. + ## Testing Tests require a test database: diff --git a/atst/app.py b/atst/app.py index d709fb5e..68ebd331 100644 --- a/atst/app.py +++ b/atst/app.py @@ -172,7 +172,7 @@ def make_upload_storage(app): app.uploader = uploader -def _map_config(config): +def _map_email_config(config): return { "server": config.get("MAIL_SERVER"), "port": config.get("MAIL_PORT"), @@ -183,7 +183,7 @@ def _map_config(config): def make_mailer(app): - config = _map_config(app.config) + config = _map_email_config(app.config) if app.config["DEBUG"]: mailer = RedisMailer(redis=app.redis, **config) else: