notifizz
v1.2.0
Published
A super powerful nodemailer wrapper tool to send email notifications with simple and user-friendly API, and very easy implementation.
Downloads
3
Maintainers
Readme
Overview
const Notifizz = require('notifizz')
//Basic Configuration
Notifizz.config({
mail: {
host: 'smtp.mailtrap.io',
port: 2525,
secure: false,
auth: {
user: '---',
pass: '---'
},
// from: 'User1 <[email protected]>' //Set from address globally,
},
// viewsDirectory: '/views' // Set html views directory where you keep all html mail files, default: /views,
templateEngine: 'ejs' // Default to null, means non-dynamic html or static html
})
const notifizz = new Notifizz
//Mail with plain text
notifizz
.from('User2 <[email protected]>') //Overrides global `from` config option
.to('[email protected]')
.subject("Your order with ID:1234567890 was successful!")
.message('Hello, Your order was successful! Thanks')
.send() //returns promise with response meta data
//Mail with static html.
notifizz
.from('User2 <[email protected]>') //Overrides global `from` config option
.to('[email protected]')
.subject("Your order with ID:1234567890 was successful!")
.view('/emails/test-html-mail.ejs',)
.send() //returns promise with response meta data
//Mail with dynamic html. here templating engine is ejs. Currently only ejs is supported. You need to set it manually from config options
notifizz
.from('User2 <[email protected]>') //Overrides global `from` config option
.to('[email protected]')
.subject("Your order with ID:1234567890 was successful!")
.view('/emails/test-html-mail.ejs', { message: "This is dynamic html" }) //Default root directory: /views, you can change from config options with `viewsDirectory` option
.send() //returns promise with response meta data