if no email dont send

v1.18.x
Baris Usakli 8 years ago
parent d13eb52f39
commit ba9397987a

@ -56,19 +56,17 @@ UserEmail.sendValidationEmail = function (uid, options, callback) {
function (next) {
// If no email passed in (default), retrieve email from uid
if (options.email && options.email.length) {
return setImmediate(next);
return setImmediate(next, null, options.email);
}
user.getUserField(uid, 'email', function (err, email) {
if (err) {
return next(err);
user.getUserField(uid, 'email', next);
},
function (email, next) {
options.email = email;
if (!options.email) {
return callback();
}
options.email = email;
next();
});
},
function (next) {
if (options.force) {
return setImmediate(next, null, false);
}

Loading…
Cancel
Save