From 0c4f2b1d053067576d63e07f2961ff0b6f33f15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 21 Apr 2021 13:38:28 +0200 Subject: [PATCH] fix notification from migration --- app/Listeners/SendNotificationMail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Listeners/SendNotificationMail.php b/app/Listeners/SendNotificationMail.php index 178df4a..fc9531e 100644 --- a/app/Listeners/SendNotificationMail.php +++ b/app/Listeners/SendNotificationMail.php @@ -21,7 +21,7 @@ class SendNotificationMail public function handle(NotifySubscriptions $event) { foreach ($event->ticket->subscriptions as $sub) { - if ($sub->email !== Auth::user()->email) { + if (Auth::user() and $sub->email !== Auth::user()->email) { Mail::to($sub->email)->send(new TicketUpdate($event->ticket, $event->corpsMaj)); } }