send-mjml
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

Send MJML

1. Import

const { Sender } = require('send-mjml')
import Sender from 'send-mjml'

2. Create a Sender

const sender = new Sender({
    service: 'gmail',
    email: 'kenmueller0@gmail.com',
    password: '•••••'
})

3. Send your email

// Returns a Promise
sender.sendMjml({
    from: 'kenmueller0@gmail.com', // If unspecified, it chooses either your `defaultFrom` (specified in the `Sender` options), or your `email`
    to: 'notken@gmail.com',
    subject: 'This is a test email',
    path: [__dirname, 'emails/test.mjml'], // Joins the paths
    context: { // Uses https://handlebarsjs.com
        name: 'Ken Mueller',
        title: 'This is a test email'
    }
})

Package Sidebar

Install

npm i send-mjml

Weekly Downloads

4

Version

1.2.0

License

MIT

Unpacked Size

4.03 kB

Total Files

4

Last publish

Collaborators

  • kenmueller