@dreesq/serpent
Version:
An express wrapper for developing fast web applications
25 lines (18 loc) • 391 B
JavaScript
const nodemailer = require('nodemailer');
/**
* The email client
*/
let client = false;
/**
* Email module
* @param context
*/
module.exports = context => {
const {config} = context.plugins;
if (!client) {
client = nodemailer.createTransport(config.get('plugins.mail'));
}
return async payload => {
return await client.sendMail(payload);
};
};