hapi-email-plugin
v0.0.1
Published
Hapi Email plugin =================
Downloads
2
Readme
Hapi Email plugin
This is a Hapi.js plugin to provide configuration and access to nodemailer.
Current maintainer: Marios Antonoudiou
Installation
$ # provide example
Configuration
server.register({
register: require('hapi-email-plugin'),
options: {
transporter: nodemailerStub()
}
}, err => {
done(err);
});
Usage
It currently provides a server method, that can send emails. Keep in mind that the email options are passed to nodemailer created transporter.
const emailOptions = {
from: '[email protected]',
to: '[email protected]',
subject: 'Test email',
text: 'Lorem ipsum dorcet sit amet',
html: '<p>Lorem ipsum dorcet sit amet</p>'
};
server.methods.sendEmail(emailOptions, (err, response) => {
// Do something
});