mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
closes #945
This commit is contained in:
@@ -32,18 +32,23 @@ Emailer.send = function(template, uid, params) {
|
|||||||
}
|
}
|
||||||
}, function(err, results) {
|
}, function(err, results) {
|
||||||
User.getUserField(uid, 'email', function(err, email) {
|
User.getUserField(uid, 'email', function(err, email) {
|
||||||
if (!err) {
|
if(err) {
|
||||||
Plugins.fireHook('action:email.send', {
|
return winston.error(err.message);
|
||||||
to: email,
|
|
||||||
from: Meta.config['email:from'] || 'no-reply@localhost.lan',
|
|
||||||
subject: params.subject,
|
|
||||||
html: results.html,
|
|
||||||
plaintext: results.plaintext,
|
|
||||||
|
|
||||||
template: template,
|
|
||||||
uid: uid
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!email) {
|
||||||
|
return winston.warn('uid : ' + uid + ' has no email, not sending.');
|
||||||
|
}
|
||||||
|
|
||||||
|
Plugins.fireHook('action:email.send', {
|
||||||
|
to: email,
|
||||||
|
from: Meta.config['email:from'] || 'no-reply@localhost.lan',
|
||||||
|
subject: params.subject,
|
||||||
|
html: results.html,
|
||||||
|
plaintext: results.plaintext,
|
||||||
|
template: template,
|
||||||
|
uid: uid
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user