Skip to content

A free open source IT asset/license management system

Fire webhook notification after sending emails

Marcus Mooreab3a3de59b64
diff --git a/app/Listeners/CheckoutableListener.php b/app/Listeners/CheckoutableListener.php
index 13579ce6b6..917a037703 100644
--- a/app/Listeners/CheckoutableListener.php
+++ b/app/Listeners/CheckoutableListener.php
@@ -45,11 +45,6 @@ class CheckoutableListener
$acceptance = $this->getCheckoutAcceptance($event);
try {
- if ($this->shouldSendWebhookNotification()) {
- Notification::route('slack', Setting::getSettings()->webhook_endpoint)
- ->notify($this->getCheckoutNotification($event));
- }
-
if (! $event->checkedOutTo->locale) {
Notification::locale(Setting::getSettings()->locale)->send(
$this->getNotifiables($event),
@@ -61,6 +56,11 @@ class CheckoutableListener
$this->getCheckoutNotification($event, $acceptance)
);
}
+
+ if ($this->shouldSendWebhookNotification()) {
+ Notification::route('slack', Setting::getSettings()->webhook_endpoint)
+ ->notify($this->getCheckoutNotification($event));
+ }
} catch (Exception $e) {
if ($e instanceof ClientException){
$statusCode = $e->getResponse()->getStatusCode();