From 8389c034509484abef5f3352fcf1a22fd5f9e349 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 13 Nov 2024 12:19:16 -0800 Subject: [PATCH] improved logging in checkoutable listener --- app/Listeners/CheckoutableListener.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 0651df197b..5b740e3f42 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -78,12 +78,13 @@ class CheckoutableListener if ($event->checkoutable->requireAcceptance() || $event->checkoutable->getEula() || (method_exists($event->checkoutable, 'checkin_email') && $event->checkoutable->checkin_email())) { + Log::info('Sending checkout email, Locale: ' . ($event->checkedOutTo->locale ?? 'default')); if (!empty($notifiable)) { Mail::to($notifiable)->cc($ccEmails)->send($mailable); } elseif (!empty($ccEmails)) { Mail::cc($ccEmails)->send($mailable); } - Log::info('Sending email, Locale: ' . ($event->checkedOutTo->locale ?? 'default')); + Log::info('Checkout Mail sent.'); } } catch (ClientException $e) { Log::debug("Exception caught during checkout email: " . $e->getMessage()); @@ -159,12 +160,13 @@ class CheckoutableListener */ if ($event->checkoutable->requireAcceptance() || $event->checkoutable->getEula() || (method_exists($event->checkoutable, 'checkin_email') && $event->checkoutable->checkin_email())) { + Log::info('Sending checkin email, Locale: ' . ($event->checkedOutTo->locale ?? 'default')); if (!empty($notifiable)) { Mail::to($notifiable)->cc($ccEmails)->send($mailable); } elseif (!empty($ccEmails)){ Mail::cc($ccEmails)->send($mailable); } - Log::info('Sending email, Locale: ' . $event->checkedOutTo->locale); + Log::info('Checkin Mail sent.'); } } catch (ClientException $e) { Log::debug("Exception caught during checkin email: " . $e->getMessage());