From 4e0d70e0b843d29115f2cd833bcc39e59ff42452 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Tue, 12 Nov 2024 15:44:14 -0800 Subject: [PATCH] checkin notif was missing --- app/Listeners/CheckoutableListener.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 8fa96acb6a..79a4774776 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -175,8 +175,14 @@ class CheckoutableListener // Send Webhook notification try { if ($this->shouldSendWebhookNotification()) { - Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint) - ->notify($this->getCheckinNotification($event)); + if (Setting::getSettings()->webhook_selected === 'microsoft') { + $message = $this->getCheckinNotification($event)->toMicrosoftTeams(); + $notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint); + $notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams + } else { + Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint) + ->notify($this->getCheckinNotification($event, $acceptance)); + } } } catch (ClientException $e) { Log::warning("Exception caught during checkin notification: " . $e->getMessage());