NodeMailer
An easy to use nodejs mailing library with integration for different templates
npm install --save nicemail
Requirements
- Node.js >= 6.11.0
- ECMAScript >= 6
Usage
const Nicemail = ;const path = ; const emailConfig = sender: 'Sender <abc@company.com>' // sender email host: 'smtp.gmail.com' port: '465' auth: user: '' pass: '' ; const templateConfig = dir: path type: 'hbs' // template type (also supports ejs and jade templates) const nm = emailConfig templateConfig;const receipents = 'abc@gmail.com''bcd@gmail.com'; nm ;
templates/simple.hbs:
{{ title }} {{ header }} {{ body }}
Other templates
templates/simple.pug:
.div #{ title } h6 #{ header } p #{ body }
templates/simple.ejs:
<%= title %> <%= header %> <%= body %>