fix: {username} not working in notification.tpl

fix images going out of notification email
v1.18.x
Barış Soner Uşaklı 6 years ago
parent 3b0459a0a5
commit f55cc66723

@ -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);

@ -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>

Loading…
Cancel
Save