Disabled sending user registration emails if disabled in the config
This commit is contained in:
parent
ff523f3f66
commit
af7972d723
|
@ -73,16 +73,20 @@ class RegisteredUserController extends Controller
|
||||||
$user = $request->name;
|
$user = $request->name;
|
||||||
$email = $request->email;
|
$email = $request->email;
|
||||||
|
|
||||||
|
if(env('REGISTER_AUTH') == 'auth'){
|
||||||
|
if(env('MANUAL_USER_VERIFICATION') == true){
|
||||||
|
try {
|
||||||
|
Mail::send('auth.user-confirmation', ['user' => $user, 'email' => $email], function ($message) use ($user) {
|
||||||
|
$message->to(env('ADMIN_EMAIL'))
|
||||||
|
->subject('New user registration');
|
||||||
|
});
|
||||||
|
} catch (\Exception $e) {}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Mail::send('auth.user-confirmation', ['user' => $user, 'email' => $email], function ($message) use ($user) {
|
$request->user()->sendEmailVerificationNotification();
|
||||||
$message->to(env('ADMIN_EMAIL'))
|
} catch (\Exception $e) {}
|
||||||
->subject('New user registration');
|
}
|
||||||
});
|
|
||||||
} catch (\Exception $e) {}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$request->user()->sendEmailVerificationNotification();
|
|
||||||
} catch (\Exception $e) {}
|
|
||||||
|
|
||||||
event(new Registered($user));
|
event(new Registered($user));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue