Socket
Socket
Sign inDemoInstall

nodemailer-handlebars

Package Overview
Dependencies
36
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nodemailer-handlebars

A plugin for nodemailer that uses express-handlebars view engine to generate emails


Version published
Weekly downloads
1.3K
decreased by-7.66%
Maintainers
1
Install size
6.72 MB
Created
Weekly downloads
 

Readme

Source

Express Handlebars plugin for Nodemailer

This plugin works with nodemailer 4.x. And uses the express-handlebars view engine to generate html emails.

Install from npm

npm install nodemailer-handlebars

Usage

//reference the plugin
var hbs = require('nodemailer-handlebars');
//attach the plugin to the nodemailer transporter
transporter.use('compile', hbs(options));
//send mail with options
var mail = {
   from: 'from@domain.com',
   to: 'to@domain.com',
   subject: 'Test',
   template: 'email',
   context: {
       name: 'Name'
   }
}
transporter.sendMail(mail);

Plugin Options

The plugin expects the following options:

  • viewEngine (required) either the express-handlebars view engine instance or options for the view engine
  • viewPath (required) provides the path to the directory where your views are
  • extName the extension of the views to use (defaults to .handlebars)

Mail options

Set the template and values properties on the mail object before calling sendMail

  • template the name of the template file to use
  • context this will be passed to the view engine as the context as well as view engine options see here

License

MIT

Keywords

FAQs

Last updated on 03 Mar 2019

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc