Fix email formatting (I think)
authorBenjamin Auder <benjamin.auder@somewhere>
Sun, 9 Feb 2020 01:55:29 +0000 (02:55 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Sun, 9 Feb 2020 01:55:29 +0000 (02:55 +0100)
server/models/User.js
server/routes/users.js
server/utils/mailer.js

index bd7e8ed..70d8b52 100644 (file)
@@ -135,7 +135,7 @@ const UserModel =
   {
     const subject = "vchess.club - notification";
     const body = "Hello " + user.name + "!" + `
   {
     const subject = "vchess.club - notification";
     const body = "Hello " + user.name + "!" + `
-    ` + message;
+` + message;
     sendEmail(params.mail.noreply, user.email, subject, body);
   },
 
     sendEmail(params.mail.noreply, user.email, subject, body);
   },
 
index e685a57..0302b1c 100644 (file)
@@ -52,10 +52,10 @@ function setAndSendLoginToken(subject, to, res)
       return res.json({errmsg: err.toString()});
     const body =
       "Hello " + to.name + "!" + `
       return res.json({errmsg: err.toString()});
     const body =
       "Hello " + to.name + "!" + `
-      ` +
+` +
       "Access your account here: " +
       params.siteURL + "/#/authenticate/" + token + `
       "Access your account here: " +
       params.siteURL + "/#/authenticate/" + token + `
-      ` +
+` +
       "Token will expire in " + params.token.expire/(1000*60) + " minutes."
     sendEmail(params.mail.noreply, to.email, subject, body, err => {
       res.json(err || {});
       "Token will expire in " + params.token.expire/(1000*60) + " minutes."
     sendEmail(params.mail.noreply, to.email, subject, body, err => {
       res.json(err || {});
index 9d3ea30..60cc9f2 100644 (file)
@@ -8,8 +8,7 @@ module.exports = function(from, to, subject, body, cb)
   {
     console.log("New mail: from " + from + " / to " + to);
     console.log("Subject: " + subject);
   {
     console.log("New mail: from " + from + " / to " + to);
     console.log("Subject: " + subject);
-    let msgText = body.split('\\n');
-    msgText.forEach(msg => { console.log(msg); });
+    console.log(body);
     if (!cb)
       cb = (err) => { if (!!err) console.log(err); }
     return cb();
     if (!cb)
       cb = (err) => { if (!!err) console.log(err); }
     return cb();