mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 07:25:46 +01:00
fix: {username} not working in notification.tpl
fix images going out of notification email
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user