7.0.0 • Published 8 months ago

nodemailer-express-handlebars v7.0.0

Weekly downloads
12,729
License
MIT
Repository
github
Last release
8 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
import hbs from '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-2327hp-bpspay-emailhp-bpspay-email2vunodevepamailingvepatekautomailervideostriming-server@cakewalk/auth91-mailjupiter-menu-managerjup-auth-handlerjup-auth-managerjupiter-auth-handlerjupiter-auth-managerjup-user-handlerlalala-apilacchain-identitylacchain-key-managerlacchain-trustlaccpass-chain-of-trustlacpass-chain-of-trustlacpass-identitylacpass-key-managerhp-parresia-emailstudy-schedulingstudent-accommodation-servicetz-emailingtravis-scott-utopiautils-library@axdp/common@b2b-official/backend@brewery/nodemailer-handlebarsvinyl-mailus1coinserver@ihelpee/travelr-domain@infinitebrahmanuniverse/nolb-nodem@kwikpik/server-libs@lumot-eu/medusa-plugin-nodemailer@mark-voicemail/common@jpmnsdeveloper/toolkit@opensearch-project/reporting-clipapercloudapp-emailersad-ee-ufcgnodejs-email-serviceng2-forms-demongx-formpizonenpmreservease-api-templatereservease-nodejs-express-templatereservease-proxyreservease.consumerrebel-auth-handlersoap-modelikea-mail-servicehp-bee-emailhp-tipoints-emailhp-trainner-emailhp-gym-emailhp-sportization-emailhp-sos-emailhp-sostruck-emailhp-sportis-emailhp-recitotal-emailhp-bombombooks-emailhp-event-signal-emailhp-hedz-emailhp-hedzhunt-emailhp-ifarm-emailhp-ldsports-emailhp-line-emailhydra-express-nodemailer-pluginlighthouse-scoresmailglidemailer-handlebarsmail-processormarket-plugin-nodemaileradnan-auth-handler@tomizap/smtpavacoreaw-notificationsbase-api-nodebase-nodejsbanana-mailconnector-email-plugdodrakodrakojserrand-messageexpressfold-frameworkeviso-email-tseviso-node-dspextramailerflex-lib
7.0.0

8 months ago

6.1.2

1 year ago

6.1.1

1 year ago

6.1.0

2 years ago

6.0.0

2 years ago

5.0.0

3 years ago

4.0.0

5 years ago

3.3.0

5 years ago

3.2.0

5 years ago

3.1.0

6 years ago

3.0.0

7 years ago

2.0.0

9 years ago

1.0.0

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago