mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
Fire webhook notification after sending emails
This commit is contained in:
parent
47a77eabf2
commit
ab3a3de59b
|
@ -45,11 +45,6 @@ class CheckoutableListener
|
||||||
$acceptance = $this->getCheckoutAcceptance($event);
|
$acceptance = $this->getCheckoutAcceptance($event);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($this->shouldSendWebhookNotification()) {
|
|
||||||
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
|
||||||
->notify($this->getCheckoutNotification($event));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $event->checkedOutTo->locale) {
|
if (! $event->checkedOutTo->locale) {
|
||||||
Notification::locale(Setting::getSettings()->locale)->send(
|
Notification::locale(Setting::getSettings()->locale)->send(
|
||||||
$this->getNotifiables($event),
|
$this->getNotifiables($event),
|
||||||
|
@ -61,6 +56,11 @@ class CheckoutableListener
|
||||||
$this->getCheckoutNotification($event, $acceptance)
|
$this->getCheckoutNotification($event, $acceptance)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->shouldSendWebhookNotification()) {
|
||||||
|
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
|
||||||
|
->notify($this->getCheckoutNotification($event));
|
||||||
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
if ($e instanceof ClientException){
|
if ($e instanceof ClientException){
|
||||||
$statusCode = $e->getResponse()->getStatusCode();
|
$statusCode = $e->getResponse()->getStatusCode();
|
||||||
|
|
Loading…
Reference in a new issue