0.0.1 • Published 9 years ago

hapi-email-plugin v0.0.1

Weekly downloads
2
License
ISC
Repository
-
Last release
9 years ago

Hapi Email plugin

wercker status

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: 'marios@thechatshop.com',
	to: 'info@thechatshop.com',
	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
});