From af7972d7237929564f59c144f9ccff7205b4e3a0 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:35:50 +0100 Subject: [PATCH] Disabled sending user registration emails if disabled in the config --- .../Auth/RegisteredUserController.php | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/Auth/RegisteredUserController.php b/app/Http/Controllers/Auth/RegisteredUserController.php index 7634f2f..ca2f5cf 100755 --- a/app/Http/Controllers/Auth/RegisteredUserController.php +++ b/app/Http/Controllers/Auth/RegisteredUserController.php @@ -73,16 +73,20 @@ class RegisteredUserController extends Controller $user = $request->name; $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 { - 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 { - $request->user()->sendEmailVerificationNotification(); - } catch (\Exception $e) {} + $request->user()->sendEmailVerificationNotification(); + } catch (\Exception $e) {} + } event(new Registered($user));