send-mjml
v1.2.0
Published
Send MJML emails with ease
Downloads
15
Readme
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: '[email protected]',
password: '•••••'
})
3. Send your email
// Returns a Promise
sender.sendMjml({
from: '[email protected]', // If unspecified, it chooses either your `defaultFrom` (specified in the `Sender` options), or your `email`
to: '[email protected]',
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'
}
})