magnet-mailer
v3.0.1
Published
Magnet adapter for nodemailer + email template
Downloads
24
Maintainers
Readme
Magnet wrapper for Nodemailer
Usage
Basic
import magnet from 'magnet-core';
import Config from 'magnet-config';
import Logger from 'magnet-bunyan';
import Mailer from 'magnet-mailer';
let app = await magnet([Config, Logger, Mailer]);
let response = await app.mailer.nodemailer.sendMail({
from: '[email protected]',
to: '[email protected]',
subject: 'Yo',
text: 'Hola'
})
server/config/mailer.js
import mg from 'nodemailer-mailgun-transport'
import htmlToText from 'nodemailer-html-to-text'
export default {
plugins: {
compile: htmlToText()
},
transport: {
host: 'smtp.gmail.com',
port: 465,
secure: true, // use SSL
auth: {
user: '[email protected]',
pass: 'pass'
}
},
transport: mg({
auth: {
api_key: 'apiKey',
domain: 'magnet.js.org'
}
})
}