@house-agency/brewmail
v0.2.7
Published
The Brewery Mailer Service
Downloads
21
Readme
The Brewery Mailer
Usage
Setup the config
{
"mail": {
"transport": {
"host": "smtp.host.tld",
"port": 443
},
"templates": {
"generic-mail": "templates/generig-mail.pug"
}
}
}
Write your mail template
subject Some nice subject with #{somevalue}
body And then your body with #{someothervalue}
Run the code
::javascript
const conf = require('@house-agency/brewtils/config').load('config.json');
const mail = require('brewmail');
// Add a mail to the queue
mail.add('[email protected]', 'generic-mail', {
somevalue: 'an hello',
someothervalue: 'a long message'
});
// Send all enqueued mail
mail.send_all_enqueued();