Use User model for email queue where possible

This commit is contained in:
DariusIII
2018-11-13 21:54:10 +01:00
parent 85269a8dfb
commit a70ad437ad
11 changed files with 98 additions and 77 deletions
@@ -60,18 +60,19 @@ class ForgotPasswordController extends Controller
if ($ret === null) {
app('smarty.view')->assign('error', 'The email or apikey are not recognised.');
$sent = true;
} else {
//
// Generate a forgottenpassword guid, store it in the user table
//
$guid = \Token::random(32);
User::updatePassResetGuid($ret['id'], $guid);
//
// Send the email
//
$resetLink = url('/').'/resetpassword?guid='.$guid;
SendPasswordForgottenEmail::dispatch($ret, $resetLink);
$sent = true;
}
//
// Generate a forgottenpassword guid, store it in the user table
//
$guid = \Token::random(32);
User::updatePassResetGuid($ret['id'], $guid);
//
// Send the email
//
$resetLink = url('/').'/resetpassword?guid='.$guid;
SendPasswordForgottenEmail::dispatch($ret['email'], $resetLink);
$sent = true;
}
$theme = Settings::settingValue('site.main.style');