mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 06:17:28 -08:00
simplified checkout webhook call
This commit is contained in:
parent
9e1b86f586
commit
16cffe9a9d
|
@ -124,16 +124,9 @@ class CheckoutableListener
|
||||||
\Log::info('Sending email, Locale: ' .$event->checkedOutTo->locale);
|
\Log::info('Sending email, Locale: ' .$event->checkedOutTo->locale);
|
||||||
// Send Webhook notification
|
// Send Webhook notification
|
||||||
if ($this->shouldSendWebhookNotification()) {
|
if ($this->shouldSendWebhookNotification()) {
|
||||||
// Slack doesn't include the URL in its messaging format, so this is needed to hit the endpoint
|
|
||||||
if (Setting::getSettings()->webhook_selected === 'slack' || Setting::getSettings()->webhook_selected === 'general') {
|
|
||||||
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
|
||||||
->notify($this->getCheckinNotification($event));
|
|
||||||
} else {
|
|
||||||
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
|
Notification::route(Setting::getSettings()->webhook_selected, Setting::getSettings()->webhook_endpoint)
|
||||||
->notify($this->getCheckinNotification($event));
|
->notify($this->getCheckinNotification($event));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
} catch (ClientException $e) {
|
} catch (ClientException $e) {
|
||||||
Log::warning("Exception caught during checkout notification: " . $e->getMessage());
|
Log::warning("Exception caught during checkout notification: " . $e->getMessage());
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
Loading…
Reference in a new issue