From 95e6259e57e044329d3abdc74dfdbc74a28ae4bd Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 12 Mar 2025 11:20:41 -0700 Subject: [PATCH 1/8] remove deprecated MS Teams checkout methods" --- .../CheckinAccessoryNotification.php | 18 ---------------- .../CheckoutAccessoryNotification.php | 21 ------------------- .../CheckoutAssetNotification.php | 18 ---------------- .../CheckoutLicenseSeatNotification.php | 18 ---------------- 4 files changed, 75 deletions(-) diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php index 28e6c054f7ad..72902c350c02 100644 --- a/app/Notifications/CheckinAccessoryNotification.php +++ b/app/Notifications/CheckinAccessoryNotification.php @@ -51,11 +51,6 @@ public function via() $notifyBy[] = GoogleChatChannel::class; } - if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) { - - $notifyBy[] = MicrosoftTeamsChannel::class; - } - if (Setting::getSettings()->webhook_selected == 'slack' || Setting::getSettings()->webhook_selected == 'general' ) { $notifyBy[] = SlackWebhookChannel::class; } @@ -92,19 +87,6 @@ public function toMicrosoftTeams() $admin = $this->admin; $item = $this->item; $note = $this->note; - if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) { - return MicrosoftTeamsMessage::create() - ->to($this->settings->webhook_endpoint) - ->type('success') - ->addStartGroupToSection('activityTitle') - ->title(trans('Accessory_Checkin_Notification')) - ->addStartGroupToSection('activityText') - ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle') - ->fact(trans('mail.checked_into'), $item->location->name ? $item->location->name : '') - ->fact(trans('mail.Accessory_Checkin_Notification')." by ", $admin->present()->fullName()) - ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) - ->fact(trans('mail.notes'), $note ?: ''); - } $message = trans('mail.Accessory_Checkin_Notification'); $details = [ diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php index 116a5ac29ff9..04d70e675dd6 100644 --- a/app/Notifications/CheckoutAccessoryNotification.php +++ b/app/Notifications/CheckoutAccessoryNotification.php @@ -50,11 +50,6 @@ public function via() $notifyBy[] = GoogleChatChannel::class; } - if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) { - - $notifyBy[] = MicrosoftTeamsChannel::class; - } - if (Setting::getSettings()->webhook_selected == 'slack' || Setting::getSettings()->webhook_selected == 'general' ) { $notifyBy[] = 'slack'; } @@ -121,22 +116,6 @@ public function toMicrosoftTeams() $item = $this->item; $note = $this->note; - if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) { - return MicrosoftTeamsMessage::create() - ->to($this->settings->webhook_endpoint) - ->type('success') - ->addStartGroupToSection('activityTitle') - ->title(trans('mail.Accessory_Checkout_Notification')) - ->addStartGroupToSection('activityText') - ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle') - ->fact(trans('mail.assigned_to'), $target->present()->name) - ->fact(trans('general.qty'), $this->checkout_qty) - ->fact(trans('mail.checkedout_from'), $item->location->name ? $item->location->name : '') - ->fact(trans('mail.Accessory_Checkout_Notification') . " by ", $admin->present()->fullName()) - ->fact(trans('admin/consumables/general.remaining'), $item->numRemaining()) - ->fact(trans('mail.notes'), $note ?: ''); - } - $message = trans('mail.Accessory_Checkout_Notification'); $details = [ trans('mail.assigned_to') => $target->present()->name, diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php index 61499e62f2e6..a3db6bead56f 100644 --- a/app/Notifications/CheckoutAssetNotification.php +++ b/app/Notifications/CheckoutAssetNotification.php @@ -68,12 +68,6 @@ public function via() $notifyBy[] = GoogleChatChannel::class; } - if (Setting::getSettings()->webhook_selected === 'microsoft' && Setting::getSettings()->webhook_endpoint) { - - $notifyBy[] = MicrosoftTeamsChannel::class; - } - - if (Setting::getSettings()->webhook_selected === 'slack' || Setting::getSettings()->webhook_selected === 'general' ) { Log::debug('use webhook'); @@ -119,18 +113,6 @@ public function toMicrosoftTeams() $item = $this->item; $note = $this->note; - if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) { - return MicrosoftTeamsMessage::create() - ->to($this->settings->webhook_endpoint) - ->type('success') - ->title(trans('mail.Asset_Checkout_Notification')) - ->addStartGroupToSection('activityText') - ->fact(trans('mail.assigned_to'), $target->present()->name) - ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityText') - ->fact(trans('mail.Asset_Checkout_Notification') . " by ", $admin->present()->fullName()) - ->fact(trans('mail.notes'), $note ?: ''); - } - $message = trans('mail.Asset_Checkout_Notification'); $details = [ trans('mail.assigned_to') => $target->present()->name, diff --git a/app/Notifications/CheckoutLicenseSeatNotification.php b/app/Notifications/CheckoutLicenseSeatNotification.php index 1aed0d200409..8d4982c50571 100644 --- a/app/Notifications/CheckoutLicenseSeatNotification.php +++ b/app/Notifications/CheckoutLicenseSeatNotification.php @@ -56,10 +56,6 @@ public function via() $notifyBy[] = GoogleChatChannel::class; } - if (Setting::getSettings()->webhook_selected == 'microsoft'){ - - $notifyBy[] = MicrosoftTeamsChannel::class; - } if (Setting::getSettings()->webhook_selected == 'slack' || Setting::getSettings()->webhook_selected == 'general' ) { $notifyBy[] = SlackWebhookChannel::class; @@ -99,20 +95,6 @@ public function toMicrosoftTeams() $item = $this->item; $note = $this->note; - if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) { - return MicrosoftTeamsMessage::create() - ->to($this->settings->webhook_endpoint) - ->type('success') - ->addStartGroupToSection('activityTitle') - ->title(trans('mail.License_Checkout_Notification')) - ->addStartGroupToSection('activityText') - ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityTitle') - ->fact(trans('mail.License_Checkout_Notification')." by ", $admin->present()->fullName()) - ->fact(trans('mail.assigned_to'), $target->present()->fullName()) - ->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count()) - ->fact(trans('mail.notes'), $note ?: ''); - } - $message = trans('mail.License_Checkout_Notification'); $details = [ trans('mail.assigned_to') => $target->present()->fullName(), From 98450c090620c554b0b0f497e50495a92d0f6a19 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 12 Mar 2025 11:46:29 -0700 Subject: [PATCH 2/8] removed deprecated MS Teams checkin methods --- app/Notifications/CheckinAssetNotification.php | 18 ------------------ .../CheckinLicenseSeatNotification.php | 17 ----------------- 2 files changed, 35 deletions(-) diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php index c6828ef8e921..9132b622490a 100644 --- a/app/Notifications/CheckinAssetNotification.php +++ b/app/Notifications/CheckinAssetNotification.php @@ -57,10 +57,6 @@ public function via() $notifyBy[] = GoogleChatChannel::class; } - if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) { - - $notifyBy[] = MicrosoftTeamsChannel::class; - } if (Setting::getSettings()->webhook_selected == 'slack' || Setting::getSettings()->webhook_selected == 'general' ) { Log::debug('use webhook'); $notifyBy[] = SlackWebhookChannel::class; @@ -99,20 +95,6 @@ public function toMicrosoftTeams() $item = $this->item; $note = $this->note; - if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) { - return MicrosoftTeamsMessage::create() - ->to($this->settings->webhook_endpoint) - ->type('success') - ->title(trans('mail.Asset_Checkin_Notification')) - ->addStartGroupToSection('activityText') - ->fact(htmlspecialchars_decode($item->present()->name), '', 'activityText') - ->fact(trans('mail.checked_into'), ($item->location) ? $item->location->name : '') - ->fact(trans('mail.Asset_Checkin_Notification') . " by ", $admin->present()->fullName()) - ->fact(trans('admin/hardware/form.status'), $item->assetstatus?->name) - ->fact(trans('mail.notes'), $note ?: ''); - } - - $message = trans('mail.Asset_Checkin_Notification'); $details = [ trans('mail.asset') => htmlspecialchars_decode($item->present()->name), diff --git a/app/Notifications/CheckinLicenseSeatNotification.php b/app/Notifications/CheckinLicenseSeatNotification.php index 1cb8706e6716..bf332e3d6ba8 100644 --- a/app/Notifications/CheckinLicenseSeatNotification.php +++ b/app/Notifications/CheckinLicenseSeatNotification.php @@ -54,10 +54,6 @@ public function via() $notifyBy[] = GoogleChatChannel::class; } - if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) { - - $notifyBy[] = MicrosoftTeamsChannel::class; - } if (Setting::getSettings()->webhook_selected == 'slack' || Setting::getSettings()->webhook_selected == 'general' ) { $notifyBy[] = SlackWebhookChannel::class; @@ -103,19 +99,6 @@ public function toMicrosoftTeams() $admin = $this->admin; $item = $this->item; $note = $this->note; - if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')) { - return MicrosoftTeamsMessage::create() - ->to($this->settings->webhook_endpoint) - ->type('success') - ->addStartGroupToSection('activityTitle') - ->title(trans('mail.License_Checkin_Notification')) - ->addStartGroupToSection('activityText') - ->fact(htmlspecialchars_decode($item->present()->name), '', 'header') - ->fact(trans('mail.License_Checkin_Notification')." by ", $admin->present()->fullName() ?: 'CLI tool') - ->fact(trans('mail.checkedin_from'), $target->present()->fullName()) - ->fact(trans('admin/consumables/general.remaining'), $item->availCount()->count()) - ->fact(trans('mail.notes'), $note ?: ''); - } $message = trans('mail.License_Checkin_Notification'); $details = [ From 0c5d790a5eacf8291fc01aa3bd4a9a45193fbdbd Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 12 Mar 2025 13:55:26 -0700 Subject: [PATCH 3/8] remove deprecated MS Teams integration test, changed message to past tense --- app/Helpers/Helper.php | 2 +- app/Livewire/SlackSettingsForm.php | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index 216245a3dbae..201c9134c901 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -722,7 +722,7 @@ public static function deprecationCheck() : array { $deprecations = [ 'ms_teams_deprecated' => array( 'check' => !Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows'), - 'message' => 'The Microsoft Teams webhook URL being used will be deprecated Jan 31st, 2025. Change webhook endpoint'), + 'message' => 'The Microsoft Teams webhook URL being used was deprecated Jan 31st, 2025. Change webhook endpoint'), ]; // if item of concern is being used and its being used with the deprecated values return the notification array. diff --git a/app/Livewire/SlackSettingsForm.php b/app/Livewire/SlackSettingsForm.php index 7487f30961b5..5bcae98eda63 100644 --- a/app/Livewire/SlackSettingsForm.php +++ b/app/Livewire/SlackSettingsForm.php @@ -247,23 +247,6 @@ public function googleWebhookTest(){ public function msTeamTestWebhook(){ try { - - if($this->teams_webhook_deprecated){ - //will use the deprecated webhook format - $payload = - [ - "@type" => "MessageCard", - "@context" => "http://schema.org/extensions", - "summary" => trans('mail.snipe_webhook_summary'), - "title" => trans('mail.snipe_webhook_test'), - "text" => trans('general.webhook_test_msg', ['app' => $this->webhook_name]), - ]; - $response = Http::withHeaders([ - 'content-type' => 'application/json', - ])->post($this->webhook_endpoint, - $payload)->throw(); - } - else { $notification = new TeamsNotification($this->webhook_endpoint); $message = trans('general.webhook_test_msg', ['app' => $this->webhook_name]); $notification->success()->sendMessage($message); @@ -271,7 +254,6 @@ public function msTeamTestWebhook(){ $response = Http::withHeaders([ 'content-type' => 'application/json', ])->post($this->webhook_endpoint); - } if(($response->getStatusCode() == 302)||($response->getStatusCode() == 301)){ return session()->flash('error' , trans('admin/settings/message.webhook.error_redirect', ['endpoint' => $this->webhook_endpoint])); From e5e69096b4f1889e1ff9104dab2d54711a6d9bf3 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 12 Mar 2025 13:56:50 -0700 Subject: [PATCH 4/8] another message change --- app/Livewire/SlackSettingsForm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Livewire/SlackSettingsForm.php b/app/Livewire/SlackSettingsForm.php index 5bcae98eda63..da224dd79a05 100644 --- a/app/Livewire/SlackSettingsForm.php +++ b/app/Livewire/SlackSettingsForm.php @@ -90,7 +90,7 @@ public function mount() { $this->isDisabled= ''; } if($this->webhook_selected === 'microsoft' && $this->teams_webhook_deprecated) { - session()->flash('warning', 'The selected Microsoft Teams webhook URL will be deprecated Jan 31st, 2025. Please use a workflow URL. Microsofts Documentation on creating a workflow can be found here.'); + session()->flash('warning', 'The selected Microsoft Teams webhook URL was deprecated Jan 31st, 2025. Please use a workflow URL. Microsofts Documentation on creating a workflow can be found here.'); } } public function updated($field) { From 6efd6e87840fadda2e6954fa34c87de583ea083a Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 12 Mar 2025 14:11:40 -0700 Subject: [PATCH 5/8] adds URL check before attempting MS teams notification --- app/Listeners/CheckoutableListener.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index 5524de9cec92..da3a585645a5 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -96,6 +96,9 @@ public function onCheckedOut($event) try { if ($this->shouldSendWebhookNotification()) { if ($this->newMicrosoftTeamsWebhookEnabled()) { + if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')){ + return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail')); + } $message = $this->getCheckoutNotification($event)->toMicrosoftTeams(); $notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint); $notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams From c4a26fc594620af1bed80e4c40a0121d3e726cd3 Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 12 Mar 2025 14:16:41 -0700 Subject: [PATCH 6/8] adds one more check --- app/Listeners/CheckoutableListener.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index da3a585645a5..d3a2f575301a 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -102,10 +102,6 @@ public function onCheckedOut($event) $message = $this->getCheckoutNotification($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($this->webhookSelected(), Setting::getSettings()->webhook_endpoint) - ->notify($this->getCheckoutNotification($event, $acceptance)); } } } catch (ClientException $e) { @@ -196,12 +192,12 @@ public function onCheckedIn($event) try { if ($this->shouldSendWebhookNotification()) { if ($this->newMicrosoftTeamsWebhookEnabled()) { + if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')){ + return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail')); + } $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($this->webhookSelected(), Setting::getSettings()->webhook_endpoint) - ->notify($this->getCheckinNotification($event)); } } } catch (ClientException $e) { From 7ad01dad8f1adda96a70714b0c364c1832bf83bb Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 12 Mar 2025 15:49:11 -0700 Subject: [PATCH 7/8] redid url check --- app/Listeners/CheckoutableListener.php | 32 +++++++++++--------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index d3a2f575301a..f6bcd410e1d1 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -94,15 +94,13 @@ public function onCheckedOut($event) } // Send Webhook notification try { - if ($this->shouldSendWebhookNotification()) { - if ($this->newMicrosoftTeamsWebhookEnabled()) { - if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')){ - return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail')); - } - $message = $this->getCheckoutNotification($event)->toMicrosoftTeams(); - $notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint); - $notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams + if ($this->shouldSendWebhookNotification()){ + if($this->isDeprecatedTeamsWebhook()){ + return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail')); } + $message = $this->getCheckoutNotification($event)->toMicrosoftTeams(); + $notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint); + $notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams } } catch (ClientException $e) { if (strpos($e->getMessage(), 'channel_not_found') !== false) { @@ -190,15 +188,13 @@ public function onCheckedIn($event) // Send Webhook notification try { - if ($this->shouldSendWebhookNotification()) { - if ($this->newMicrosoftTeamsWebhookEnabled()) { - if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')){ - return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail')); - } - $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 + if ($this->shouldSendWebhookNotification()){ + if($this->isDeprecatedTeamsWebhook()){ + return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail')); } + $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 } } catch (ClientException $e) { if (strpos($e->getMessage(), 'channel_not_found') !== false) { @@ -380,8 +376,8 @@ private function checkoutableShouldSendEmail($event): bool return (method_exists($event->checkoutable, 'checkin_email') && $event->checkoutable->checkin_email()); } - private function newMicrosoftTeamsWebhookEnabled(): bool + private function isDeprecatedTeamsWebhook(): bool { - return Setting::getSettings()->webhook_selected === 'microsoft' && Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows'); + return !Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows'); } } From ebe07c20742624fccec36a5aefebbd18fc9b372f Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 12 Mar 2025 16:05:14 -0700 Subject: [PATCH 8/8] removed too much code, tests pass --- app/Listeners/CheckoutableListener.php | 34 +++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php index f6bcd410e1d1..fd5c634856a1 100644 --- a/app/Listeners/CheckoutableListener.php +++ b/app/Listeners/CheckoutableListener.php @@ -94,13 +94,18 @@ public function onCheckedOut($event) } // Send Webhook notification try { - if ($this->shouldSendWebhookNotification()){ - if($this->isDeprecatedTeamsWebhook()){ - return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail')); + if ($this->shouldSendWebhookNotification()) { + if (Setting::getSettings()->webhook_selected === 'microsoft') { + if ($this->isDeprecatedTeamsWebhook()) { + return redirect()->back()->with('warning', trans('admin/settings/message.webhook.webhook_fail')); + } + $message = $this->getCheckoutNotification($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($this->webhookSelected(), Setting::getSettings()->webhook_endpoint) + ->notify($this->getCheckoutNotification($event, $acceptance)); } - $message = $this->getCheckoutNotification($event)->toMicrosoftTeams(); - $notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint); - $notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams } } catch (ClientException $e) { if (strpos($e->getMessage(), 'channel_not_found') !== false) { @@ -188,13 +193,18 @@ public function onCheckedIn($event) // Send Webhook notification try { - if ($this->shouldSendWebhookNotification()){ - if($this->isDeprecatedTeamsWebhook()){ - return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail')); + if ($this->shouldSendWebhookNotification()) { + if (Setting::getSettings()->webhook_selected === 'microsoft') { + if ($this->isDeprecatedTeamsWebhook()) { + return redirect()->back()->with('warning', trans('admin/settings/message.webhook.webhook_fail')); + } + $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($this->webhookSelected(), Setting::getSettings()->webhook_endpoint) + ->notify($this->getCheckinNotification($event)); } - $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 } } catch (ClientException $e) { if (strpos($e->getMessage(), 'channel_not_found') !== false) {