
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
mustache-mailer
Advanced tools
A mustache-template-backed mailer. Built with handlebars, and nodemailer, inspired by ActionMailer.
foo.text.hbs, for text email templates.foo.meta.hbs, meta information in JSON format, e.g., subject.foo.html.hbs, for html email templates.MustacheMailer with:transport: the transport module you wish to use, e.g., SES.templateDir: the path to the template directory.var mm = new MustacheMailer({
transport: require('nodemailer-ses-transport')({
accessKeyId: 'AWSACCESSKEY',
secretAccessKey: 'AWS/Secret/key'
}),
templateDir: './mail-templates'
});
MessageMailer instance to grab a template:html template and a text template, both will be sent.sendMail are sent to nodemailer, and
to the mustache templates.var msg = mm.message('confirmation', function(err, msg) {
msg.sendMail({
to: 'bencoe@gmail.com',
name: 'Ben',
id: 'adfasdfadsfasdf'
});
}
tokenFacilitator PluginIt often arises that you'd like to toss a token inside an email, e.g., click this confirmation link to change your password.
For generating these tokens, MustacheMailer allows you to install a
tokenFacilitator plugin:
var mm = new MustacheMailer({
transport: mock,
templateDir: path.resolve(__dirname, './fixtures'),
// a fake token facilitator.
tokenFacilitator: {
generate: function(data, cb) {
setTimeout(function() {
data.email.should.eql('zeke@example.com');
data.name.should.eql('Zeke');
return cb(null, parseInt(Math.random() * 256));
}, 20);
}
}
});
http://example.com/{{{tokenHelper name=name email=email}}}
key, value pairs in data.FAQs
send emails using nodemailer, and mustache templates.
We found that mustache-mailer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 28 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.