6.1.2 • Published 3 months ago

nodemailer-express-handlebars v6.1.2

Weekly downloads
12,729
License
MIT
Repository
github
Last release
3 months ago

Express Handlebars plugin for Nodemailer

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

Install from npm

npm install nodemailer-express-handlebars

Usage

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

You can send a multipart html and text email by setting the text_template option on a mail message.

const mail = {
   from: 'from@domain.com',
   to: 'to@domain.com',
   subject: 'Test',
   template: 'email',
   text_template: 'text',
   context: {
       name: 'Name'
   }
}

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

@zelmigreyling/thosedevs-helpersjupiter-menu-handlerdev_nativeapiautomaillerberkayeviso-email-dspcc-notifications@hackfiu/bananalarapress@everything-registry/sub-chunk-2327aw-notificationsbase-api-nodebase-nodejs@brewery/nodemailer-handlebarsikea-mail-service@cakewalk/auth91-mailconnector-email-plugdobanana-mailjup-auth-handlerjup-auth-managerjup-user-handlerjupiter-auth-handlerjupiter-auth-managerjupiter-menu-managerlacchain-identitylacchain-key-managerlacchain-trustlaccpass-chain-of-trustlighthouse-scores@infinitebrahmanuniverse/nolb-nodem@ihelpee/travelr-domainmarket-plugin-nodemailerlacpass-chain-of-trustlacpass-identitylacpass-key-managerlalala-apimail-processormailer-handlebarsmailglideng2-forms-demongx-formpapercloudapp-emailernodejs-email-servicepizonenpm@jpmnsdeveloper/toolkitsoap-modelerrand-messageextramailervunodeeviso-email-tseviso-node-dspexpressfold-frameworkstudent-accommodation-servicestudy-schedulingreservease-api-templatereservease-nodejs-express-templatereservease-proxyreservease.consumersad-ee-ufcg@opensearch-project/reporting-clirebel-auth-handler@mark-voicemail/commondrakodrakojstravis-scott-utopiaadnan-auth-handlerus1coinservervideostriming-servervepamailingvepatekautomailervinyl-mailhp-sostruck-emailhp-sportis-emailhp-sportization-emailhp-shield-emailhp-sos-emailutils-libraryhp-event-signal-emailhp-hedz-emailhp-hedzhunt-emailhp-ifarm-emailhp-ldsports-emailhp-line-emailhp-bee-emailhp-bombombooks-emailhp-parresia-emailhp-recitotal-emailhp-bpspay-emailhp-bpspay-email2hp-gym-emailhp-tipoints-emailhp-trainner-emailhydra-express-nodemailer-plugin@axdp/common@b2b-official/backendavacore
6.1.2

3 months ago

6.1.1

3 months ago

6.1.0

1 year ago

6.0.0

1 year ago

5.0.0

2 years ago

4.0.0

4 years ago

3.3.0

4 years ago

3.2.0

4 years ago

3.1.0

5 years ago

3.0.0

6 years ago

2.0.0

8 years ago

1.0.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago