nodemailer-pug-engine
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Nodemailer-pug-engine

Install

npm install nodemailer-pug-engine

Usage

// typescript
import { pugEngine } from "nodemailer-pug-engine";

// javascript
const { pugEngine } = require("nodemailer-pug-engine");



const mailer = createTransport(...)

mailer.use('compile', pugEngine({
    templateDir: __dirname + '/templates',
    pretty: true
}));

mailer.sendMail({
    to: '..',
    template: 'test',   // defines the template to compile for the email
    ctx: {
        // this is available in the template
    }
});

Options

pugEngine

templateDir {string} - Path to templates directory

pretty {boolean} optional - Pretty print html (defaults to false)

sendMail Options

template {string} optional - defines the template relative to the pugEngine templateDir

ctx {object} optional - this is the available context in the pug template

Package Sidebar

Install

npm i nodemailer-pug-engine

Weekly Downloads

3,490

Version

2.0.1

License

MIT

Unpacked Size

22.5 kB

Total Files

10

Last publish

Collaborators

  • bexxx