mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
closes #2315
This commit is contained in:
@@ -36,21 +36,25 @@ Emailer.send = function(template, uid, params) {
|
||||
next(undefined, translated);
|
||||
});
|
||||
}, function(err, translated) {
|
||||
if(err) {
|
||||
if (err) {
|
||||
return winston.error(err.message);
|
||||
} else if (!results.email) {
|
||||
return winston.warn('uid : ' + uid + ' has no email, not sending.');
|
||||
}
|
||||
|
||||
Plugins.fireHook('action:email.send', {
|
||||
to: results.email,
|
||||
from: meta.config['email:from'] || 'no-reply@localhost.lan',
|
||||
subject: translated[2],
|
||||
html: translated[0],
|
||||
plaintext: translated[1],
|
||||
template: template,
|
||||
uid: uid
|
||||
});
|
||||
if (Plugins.hasListeners('action:email.send')) {
|
||||
Plugins.fireHook('action:email.send', {
|
||||
to: results.email,
|
||||
from: meta.config['email:from'] || 'no-reply@localhost.lan',
|
||||
subject: translated[2],
|
||||
html: translated[0],
|
||||
plaintext: translated[1],
|
||||
template: template,
|
||||
uid: uid
|
||||
});
|
||||
} else {
|
||||
winston.warn('[emailer] No active email plugin found!');
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user