coins-mail-daemon
On start coins-mail-daemon
fetches all unsent messages from the mrsdba.mrs_mail
table and queues timeouts internally to send each email based on the records send_date
. Additionally coins-mail-daemon
also uses Postgres notify events on the dd
channel to listen for new records inserted into the mrs_mail
table.
.env [Environment Variables]
Coins-Mail-Daemon loads configuration via dotenv
- For local development copy
.env.example
to .env
and edit it's values appropriately - In deployment however these values are set on the host as Environment Variables via Ansible deploys
Required Variables (Local Dev)
Variable | Default | Edit Required |
---|
COINS_ENV | | NO (See: #Recipient Override below ) |
ADMIN_EMAIL | coinsdev@trendscenter.org | |
SMTP_HOST | smtp.gmail.com | Possibly |
SMTP_PORT | 465 | Possibly |
SMTP_USERNAME | | YES |
SMTP_PASSWORD | | YES |
SMTP_MAX_CONNECTIONS | 1 | NO |
SMTP_RATE_DELTA | 300000 | NO |
SMTP_RATE_LIMIT | 60 | NO |
DB_HOST | localhost | |
DB_PORT | 5432 | |
DB_DATABASE | coins | |
DB_USERNAME_NODE_API | postgres | Possibly |
DB_PASSWORD_NODE_API | | YES |
Recipient Override
Emails created from a non-production server are sent to an admin email account instead of the specified recipient.
COINS_ENV=PRODUCTION
- emails are sent to the intended recipient like normal
- Any other
COINS_ENV
(for example: COINS_ENV=development
)
- email's
sendTo
field will be overwritten with the ADMIN_EMAIL
value