Node.js based forum software built for the modern web
fix: {username} not working in notification.tpl
Barış Soner Uşaklıf55cc66723d0
diff --git a/src/emailer.js b/src/emailer.jsindex b75a672e88..627983b3be 100644--- a/src/emailer.js+++ b/src/emailer.js@@ -199,18 +199,19 @@ Emailer.send = function (template, uid, params, callback) {async.waterfall([function (next) {async.parallel({- email: async.apply(User.getUserField, uid, 'email'),+ userData: async.apply(User.getUserFields, uid, ['email', 'username']),settings: async.apply(User.getSettings, uid),}, next);},async function (results) {- if (!results.email) {+ if (!results.userData || !results.userData.email) {winston.warn('uid : ' + uid + ' has no email, not sending.');return;}params.uid = uid;+ params.username = results.userData.username;params.rtl = await translator.translate('[[language:dir]]', results.settings.userLang) === 'rtl';- Emailer.sendToEmail(template, results.email, results.settings.userLang, params, function () {});+ Emailer.sendToEmail(template, results.userData.email, results.settings.userLang, params, function () {});},], function (err) {return callback(err);diff --git a/src/views/emails/notification.tpl b/src/views/emails/notification.tplindex b9fadef623..c7437a7432 100644--- a/src/views/emails/notification.tpl+++ b/src/views/emails/notification.tpl@@ -17,9 +17,9 @@<h1 style="margin: 0 0 10px 0; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol; font-size: 18px; line-height: 21px; color: #aaaaaa; font-weight: normal;">{intro}</h1></td></tr>- <tr>+ <tr class="notification-body"><td style="padding: 20px 40px; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol; font-size: 15px; line-height: 20px; color: #555555;">- <p class="notification-body" style="margin: 0; padding: 6px 0px; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol; font-size: 13px; line-height: 26px; color: #666666;">+ <p style="margin: 0; padding: 6px 0px; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol; font-size: 13px; line-height: 26px; color: #666666;">{body}</p></td>