|
|
|
@ -36,12 +36,13 @@ Emailer.send = function(template, uid, params) {
|
|
|
|
next(undefined, translated);
|
|
|
|
next(undefined, translated);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}, function(err, translated) {
|
|
|
|
}, function(err, translated) {
|
|
|
|
if(err) {
|
|
|
|
if (err) {
|
|
|
|
return winston.error(err.message);
|
|
|
|
return winston.error(err.message);
|
|
|
|
} else if (!results.email) {
|
|
|
|
} else if (!results.email) {
|
|
|
|
return winston.warn('uid : ' + uid + ' has no email, not sending.');
|
|
|
|
return winston.warn('uid : ' + uid + ' has no email, not sending.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Plugins.hasListeners('action:email.send')) {
|
|
|
|
Plugins.fireHook('action:email.send', {
|
|
|
|
Plugins.fireHook('action:email.send', {
|
|
|
|
to: results.email,
|
|
|
|
to: results.email,
|
|
|
|
from: meta.config['email:from'] || 'no-reply@localhost.lan',
|
|
|
|
from: meta.config['email:from'] || 'no-reply@localhost.lan',
|
|
|
|
@ -51,6 +52,9 @@ Emailer.send = function(template, uid, params) {
|
|
|
|
template: template,
|
|
|
|
template: template,
|
|
|
|
uid: uid
|
|
|
|
uid: uid
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
winston.warn('[emailer] No active email plugin found!');
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|