checkin notif was missing

This commit is contained in:
Godfrey M 2024-11-12 15:44:14 -08:00
parent 832ccc6aa3
commit 4e0d70e0b8

View file

@ -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());