From a9b7f7733cc76ed1005a8bea91ff03c254ab1c99 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Sat, 11 Dec 2021 13:35:21 +0330 Subject: [PATCH] Send EmailVerified email notification --- .../Actions/VerifyEmailAction.php | 4 +-- .../Notifications/EmailVerified.php | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 app/Containers/AppSection/Authentication/Notifications/EmailVerified.php diff --git a/app/Containers/AppSection/Authentication/Actions/VerifyEmailAction.php b/app/Containers/AppSection/Authentication/Actions/VerifyEmailAction.php index 33649cf2d..c060ac185 100644 --- a/app/Containers/AppSection/Authentication/Actions/VerifyEmailAction.php +++ b/app/Containers/AppSection/Authentication/Actions/VerifyEmailAction.php @@ -2,9 +2,9 @@ namespace App\Containers\AppSection\Authentication\Actions; +use App\Containers\AppSection\Authentication\Notifications\EmailVerified; use App\Containers\AppSection\Authentication\UI\API\Requests\VerifyEmailRequest; use App\Ship\Parents\Actions\Action; -use Illuminate\Auth\Events\Verified; class VerifyEmailAction extends Action { @@ -13,7 +13,7 @@ public function run(VerifyEmailRequest $request): void if (!$request->user()->hasVerifiedEmail()) { $request->user()->markEmailAsVerified(); - event(new Verified($request->user())); + $request->user()->notify(new EmailVerified()); } } } diff --git a/app/Containers/AppSection/Authentication/Notifications/EmailVerified.php b/app/Containers/AppSection/Authentication/Notifications/EmailVerified.php new file mode 100644 index 000000000..88f2473dd --- /dev/null +++ b/app/Containers/AppSection/Authentication/Notifications/EmailVerified.php @@ -0,0 +1,26 @@ +subject('Email Verified') + ->line('Your email has been verified.'); + } +}