2015-09-22 04:15:53 +05:30
|
|
|
# Configuring Sending Emails
|
|
|
|
|
|
|
|
Dex sends emails to a during the registration process to verify an email
|
|
|
|
address belongs to the person signing up. Currently Dex supports two ways of
|
|
|
|
sending emails, and has a third option for use during development.
|
|
|
|
|
|
|
|
Configuration of the email provider in Dex is provided through a JSON file. All
|
|
|
|
email providers have a `type` and `id` field as well as some additional provider
|
|
|
|
specific fields.
|
|
|
|
|
|
|
|
## SMTP
|
|
|
|
|
|
|
|
If using SMTP the `type` field **must** be set to `smtp`. Additionally both
|
|
|
|
`host` and `port` are required. If you wish to use SMTP plain auth, then
|
2016-07-11 21:46:32 +05:30
|
|
|
specify your username and password.
|
2015-09-22 04:15:53 +05:30
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"type": "smtp",
|
2016-07-11 21:46:32 +05:30
|
|
|
"host": "smtp.example.org:587",
|
2016-06-28 12:04:55 +05:30
|
|
|
"from": "postmaster@example.com",
|
2015-09-22 04:15:53 +05:30
|
|
|
"username": "postmaster@example.org",
|
|
|
|
"password": "foo"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Mailgun
|
|
|
|
|
|
|
|
If using Mailgun the `type` field **must** be set to `mailgun`. Additionally
|
|
|
|
`privateAPIKey`, `publicAPIKey`, and `domain` are required.
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"type": "mailgun",
|
2016-06-28 12:04:55 +05:30
|
|
|
"from": "noreply@example.com",
|
2015-09-22 04:15:53 +05:30
|
|
|
"privateAPIKey": "key-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
|
|
|
"publicAPIKey": "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY",
|
|
|
|
"domain": "sandboxZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ.mailgun.org"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Dev
|
|
|
|
|
|
|
|
The fake emailer should only be used in development. The fake emailer
|
|
|
|
prints emails to `stdout` rather than sending any email. If using the fake
|
|
|
|
emailer the `type` field **must** be set to `fake`.
|
|
|
|
|
|
|
|
```
|
|
|
|
{
|
|
|
|
"type": "fake"
|
|
|
|
}
|
2016-06-28 12:04:55 +05:30
|
|
|
```
|