-
Notifications
You must be signed in to change notification settings - Fork 11
E mail system
tiblu edited this page Sep 11, 2018
·
7 revisions
We use https://github.com/bevacqua/campaign to send e-mails.
- Email client source - https://github.com/citizenos/citizenos-api/blob/master/libs/campaign/emailClient.js
- Lib to make up the CitizenOS e-mails and uses
emailClient.js
to send e-mails - https://github.com/citizenos/citizenos-api/blob/master/libs/email.js - All e-mail layout related files are in
citizenos-api/views/emails
folder.
You can use following providers
- noop - does nothing, emails are sent to emptyness
- terminal - emails are sent to standard output
- nodemailer - emails over SMTP
- mailgun - Mailgun (https://www.mailgun.com/). You need to signup with Mailgun but they have awesome free plan, so for most cases it should be more than enough.
"email": {
"provider": {
"name": "noop"
}
},
"email": {
"provider": {
"name": "terminal"
}
},
"email": {
"provider": {
"name": "nodemailer",
"options": {
"service": "Gmail",
"auth": {
"user": "[email protected]",
"pass": "GEMAILPASSWORD"
}
}
},
"trap": "[email protected]",
"from": "CitizenOs Dev <[email protected]>"
}
"email": {
"provider": {
"name": "nodemailer",
"options": {
"host": "smtp.gmail.com",
"secureConnection": true,
"port": 465,
"auth": {
"user": "[email protected]",
"pass": "userpass"
}
}
},
"trap": "[email protected]",
"from": "CitizenOs Dev <[email protected]>"
}
NOTES:
-
trap
- where all e-mails are actually sent despite what the "to" line says. Useful for testing and development environments. Iffalse
, the e-mail is sent to the "to". - All possible SMTP configuration options are described here - https://github.com/nodemailer/nodemailer/tree/da2f1d278f91b4262e940c0b37638e7027184b1d#setting-up-smtp
You need to signup with Mailgun - https://www.mailgun.com/. They have awesome free plan, so for most cases it should be more than enough.
{
"provider": {
"name": "mailgun",
"options": {
"apiKey": "key-YOURAPIKEY",
"authority": "YOURDOMAIN.com"
}
},
"from": "CitizenOS <[email protected]>",
"trap": false
}
NOTES:
-
trap
- where all e-mails are actually sent despite what the "to" line says. Useful for testing and development environments. Iffalse
, the e-mail is sent to the "to".
All e-mail related files are in citizenos-api/views/emails
folder.
We offer limited configuration via citizenos-api/config/emails
, more info here https://github.com/citizenos/citizenos-api/blob/master/config/emails/README.md