Skip to content

Commit 4e0d70e

Browse files
committed
checkin notif was missing
1 parent 832ccc6 commit 4e0d70e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/Listeners/CheckoutableListener.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,14 @@ public function onCheckedIn($event)
175175
// Send Webhook notification
176176
try {
177177
if ($this->shouldSendWebhookNotification()) {
178-
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
179-
->notify($this->getCheckinNotification($event));
178+
if (Setting::getSettings()->webhook_selected === 'microsoft') {
179+
$message = $this->getCheckinNotification($event)->toMicrosoftTeams();
180+
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
181+
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
182+
} else {
183+
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
184+
->notify($this->getCheckinNotification($event, $acceptance));
185+
}
180186
}
181187
} catch (ClientException $e) {
182188
Log::warning("Exception caught during checkin notification: " . $e->getMessage());

0 commit comments

Comments
 (0)