X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=server%2Futils%2Fmailer.js;h=96fa75cfee755ff3f77f9b6095593f8b6dea4031;hb=2bb4666e276e837add0958554a11b38f7f4d9357;hp=b0a0bacef90f69ac18860f409c58342cdbab1f7b;hpb=866842c3c310524c034922870234120ed2a16cbf;p=vchess.git diff --git a/server/utils/mailer.js b/server/utils/mailer.js index b0a0bace..96fa75cf 100644 --- a/server/utils/mailer.js +++ b/server/utils/mailer.js @@ -1,24 +1,21 @@ const nodemailer = require('nodemailer'); const params = require("../config/parameters"); -module.exports = function(from, to, subject, body, cb) -{ +module.exports = function(from, to, subject, body, cb) { // Avoid the actual sending in development mode - if (params.env === 'development') - { + if (params.env === 'development') { console.log("New mail: from " + from + " / to " + to); console.log("Subject: " + subject); console.log(body); - if (!cb) - cb = (err) => { if (err) console.log(err); } + if (!cb) cb = (err) => { if (err) console.log(err); } cb(); return; } // Production-only code from here: - if (!cb) - cb = () => {}; //default: do nothing (TODO: log somewhere) + // Default: do nothing (TODO: log somewhere) + if (!cb) cb = () => {}; // Create reusable transporter object using the default SMTP transport const transporter = nodemailer.createTransport({ @@ -46,4 +43,4 @@ module.exports = function(from, to, subject, body, cb) //console.log('Message sent: %s', info.messageId); cb(error); }); -} +};