Preview your Nodemailer emails in your browser (Inspired by Letter Opener).
Install via npm
$ npm install mail-preview
Use it with Nodemailer
var nodemailer = require('nodemailer');
var path = require('path');
require('mail-preview');
var tmpdir = path.join(__dirname, 'tmp', 'nodemailer');
var transport = nodemailer.createTransport('MailPreview', {
dir: tmpdir, // defaults to ./tmp/nodemailer
browser: true // open sent email in browser (defaults to true)
});
Any emails sent through the MailPreview
transport will be written to the
tmpdir
and opened in a browser (unless browser
is set to false).
Clone the repo
$ git clone git@github.com:davidcornu/mail-preview.git
Install dependencies
$ npm install
Run the tests
$ npm test