- // Avoid the actual sending in development mode
- if (params.env === 'development')
- {
- console.log("New mail: from " + from + " / to " + to);
- console.log("Subject: " + subject);
- let msgText = body.split('\\n');
- msgText.forEach(msg => { console.log(msg); });
- return cb();
- }
+ // Avoid the actual sending in development mode
+ 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); }
+ cb();
+ return;
+ }
+
+ // Production-only code from here:
+
+ if (!cb)
+ cb = () => {}; //default: do nothing (TODO: log somewhere)