Skip to content

A free open source IT asset/license management system

Merge branch 'develop' into general-hook_fix

Godfrey Martinez9dcd14a71220
diff --cc app/Listeners/CheckoutableListener.php
index 3f3e23f1c7,86a0957839..6aa0a0d376
--- a/app/Listeners/CheckoutableListener.php
+++ b/app/Listeners/CheckoutableListener.php
@@@ -60,8 -60,8 +60,10 @@@ class CheckoutableListene
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 !='microsoft') {
++
+ if(Setting::getSettings()->webhook_selected =='slack' || Setting::getSettings()->webhook_selected =='general') {
+
+
Notification::route('slack', Setting::getSettings()->webhook_endpoint)
->notify($this->getCheckoutNotification($event));
}
diff --cc app/Notifications/CheckoutAssetNotification.php
index 36697c21d9,a2fe275ae2..398be13844
--- a/app/Notifications/CheckoutAssetNotification.php
+++ b/app/Notifications/CheckoutAssetNotification.php
@@@ -54,13 -61,18 +61,20 @@@ class CheckoutAssetNotification extend
*/
public function via()
{
+ $notifyBy = [];
+ if (Setting::getSettings()->webhook_selected == 'google'){
+
+ $notifyBy[] = GoogleChatChannel::class;
+ }
+
if (Setting::getSettings()->webhook_selected == 'microsoft'){
- return [MicrosoftTeamsChannel::class];
+ $notifyBy[] = MicrosoftTeamsChannel::class;
}
- $notifyBy = [];
+
- if ((Setting::getSettings()->webhook_selected == 'slack') || (Setting::getSettings()->webhook_selected == '')) {
+
+ if (Setting::getSettings()->webhook_selected == 'slack' || Setting::getSettings()->webhook_selected == 'general' ) {
++
\Log::debug('use webhook');
$notifyBy[] = 'slack';
}