Hapi Email Server as a plugin
npm install postofficePost Office is using couchbase with puffer library to register trigger points for emails and send emails to both list of subscribers and an email
* Source code is available at here
You have to pass these variables to plugin.
``yaml`
mail:
api_key: your_mailgun_api_key
domain: your_mailgun_domain
from: My Name
mock: false
lable: mail
root: /path/to/templates/root
trigger_events:
event1_name:
template: /path/to/template
subject: event_mail_subject
event2_name:
template: /path/to/template
subject: event_mail_subject
You should start a postoffice server in your code and also pass configuration to the postoffice server plugin:
`coffee
server.connection { port: Number(config.server.mail.port), labels: config.server.mail.label }
db = new require('puffer')(config.database)
server.register [ { register: require('postoffice'), options: { config: config.server.mail, database: db, url: config.url, scheme: config.scheme } } ], (err) -> throw err if err
``