const nodemailer = require('nodemailer'); const smtpConfig = require('./smtp-config').config; /** * An example of the args * * { to: 'bob@example.com', * from: 'example ', * cc: '', * bcc: '', * reply_to: '', * subject: 'Alice has sent a message to you!', * text: 'text...', * html: '...' } */ exports.sendEmail = (mailOptions) => { console.log('mailOptions', mailOptions); var transporter = nodemailer.createTransport(smtpConfig); transporter.sendMail(mailOptions, function(error, info){ if(error){ return console.log(error); } console.log('Message sent: ' + info.response); }); }