mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-03 09:57:45 -08:00
fixes general webhook not firing
This commit is contained in:
parent
a7d5b3944e
commit
99464fcd86
|
@ -100,7 +100,7 @@ class CheckoutableListener
|
||||||
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
|
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
|
||||||
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
|
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
|
||||||
} else {
|
} else {
|
||||||
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
|
Notification::route($this->webhookSelected(), Setting::getSettings()->webhook_endpoint)
|
||||||
->notify($this->getCheckoutNotification($event, $acceptance));
|
->notify($this->getCheckoutNotification($event, $acceptance));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ class CheckoutableListener
|
||||||
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
|
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
|
||||||
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
|
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams
|
||||||
} else {
|
} else {
|
||||||
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
|
Notification::route($this->webhookSelected(), Setting::getSettings()->webhook_endpoint)
|
||||||
->notify($this->getCheckinNotification($event));
|
->notify($this->getCheckinNotification($event));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,6 +310,13 @@ class CheckoutableListener
|
||||||
return $event->checkedOutTo?->email ?? '';
|
return $event->checkedOutTo?->email ?? '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private function webhookSelected(){
|
||||||
|
if(Setting::getSettings()->webhook_selected === 'slack' || Setting::getSettings()->webhook_selected === 'general'){
|
||||||
|
return 'slack';
|
||||||
|
}
|
||||||
|
|
||||||
|
return Setting::getSettings()->webhook_selected;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register the listeners for the subscriber.
|
* Register the listeners for the subscriber.
|
||||||
|
|
Loading…
Reference in a new issue