update README, adjust email config function name
This commit is contained in:
parent
ae909117f4
commit
ae7c644d91
16
README.md
16
README.md
@ -111,6 +111,22 @@ projects for all of the test users:
|
|||||||
|
|
||||||
`pipenv run python script/seed_sample.py`
|
`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
|
## Testing
|
||||||
|
|
||||||
Tests require a test database:
|
Tests require a test database:
|
||||||
|
@ -172,7 +172,7 @@ def make_upload_storage(app):
|
|||||||
app.uploader = uploader
|
app.uploader = uploader
|
||||||
|
|
||||||
|
|
||||||
def _map_config(config):
|
def _map_email_config(config):
|
||||||
return {
|
return {
|
||||||
"server": config.get("MAIL_SERVER"),
|
"server": config.get("MAIL_SERVER"),
|
||||||
"port": config.get("MAIL_PORT"),
|
"port": config.get("MAIL_PORT"),
|
||||||
@ -183,7 +183,7 @@ def _map_config(config):
|
|||||||
|
|
||||||
|
|
||||||
def make_mailer(app):
|
def make_mailer(app):
|
||||||
config = _map_config(app.config)
|
config = _map_email_config(app.config)
|
||||||
if app.config["DEBUG"]:
|
if app.config["DEBUG"]:
|
||||||
mailer = RedisMailer(redis=app.redis, **config)
|
mailer = RedisMailer(redis=app.redis, **config)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user