diff --git a/lib/LxMail.js b/lib/LxMail.js index 9353c73..70d5ade 100644 --- a/lib/LxMail.js +++ b/lib/LxMail.js @@ -75,17 +75,17 @@ module.exports = function (config) { * @param {function} callback The callback function. */ pub.sendMail = function (mail, callback) { - var mailMessage = configureMail(mail, config); + configureMail(mail, config); // add html to text compiler - if (mailMessage.html) { + if (mail.html) { var htmlToText = require('nodemailer-html-to-text').htmlToText; transport.use('compile', htmlToText()); } - debug('Send mail', mailMessage); + debug('Send mail', mail); - transport.sendMail(mailMessage, function (error, result) { + transport.sendMail(mail, function (error, result) { callback(error, result); }); };