update README, adjust email config function name

This commit is contained in:
dandds 2018-10-12 09:15:56 -04:00
parent ae909117f4
commit ae7c644d91
2 changed files with 18 additions and 2 deletions

View File

@ -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 = <SMTP server URL>
MAIL_PORT = <SMTP server port>
MAIL_SENDER = <Login name for the email account and sender address>
MAIL_PASSWORD = <login password for the email account>
MAIL_TLS = <Boolean, whether TLS should be enabled for outgoing email. Defaults to false.>
```
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:

View File

@ -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: