Skip to content

A free open source IT asset/license management system

Ensure webhook endpoint is set before attempting to send to google or microsoft

Marcus Moore4b0bfc52b40e
diff --git a/app/Notifications/CheckinAccessoryNotification.php b/app/Notifications/CheckinAccessoryNotification.php
index 8cfca23e59..f83bff2c64 100644
--- a/app/Notifications/CheckinAccessoryNotification.php
+++ b/app/Notifications/CheckinAccessoryNotification.php
@@ -43,12 +43,12 @@ class CheckinAccessoryNotification extends Notification
public function via()
{
$notifyBy = [];
- if (Setting::getSettings()->webhook_selected == 'google'){
+ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
- if (Setting::getSettings()->webhook_selected == 'microsoft'){
+ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}
diff --git a/app/Notifications/CheckinAssetNotification.php b/app/Notifications/CheckinAssetNotification.php
index ed3eae2c72..f62108c50b 100644
--- a/app/Notifications/CheckinAssetNotification.php
+++ b/app/Notifications/CheckinAssetNotification.php
@@ -51,12 +51,12 @@ class CheckinAssetNotification extends Notification
public function via()
{
$notifyBy = [];
- if (Setting::getSettings()->webhook_selected == 'google'){
+ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
- if (Setting::getSettings()->webhook_selected == 'microsoft'){
+ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}
diff --git a/app/Notifications/CheckinLicenseSeatNotification.php b/app/Notifications/CheckinLicenseSeatNotification.php
index 7aa02b965a..289e63a162 100644
--- a/app/Notifications/CheckinLicenseSeatNotification.php
+++ b/app/Notifications/CheckinLicenseSeatNotification.php
@@ -48,11 +48,11 @@ class CheckinLicenseSeatNotification extends Notification
{
$notifyBy = [];
- if (Setting::getSettings()->webhook_selected == 'google'){
+ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
- if (Setting::getSettings()->webhook_selected == 'microsoft'){
+ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}
diff --git a/app/Notifications/CheckoutAccessoryNotification.php b/app/Notifications/CheckoutAccessoryNotification.php
index 08b80e75ad..1ced92f706 100644
--- a/app/Notifications/CheckoutAccessoryNotification.php
+++ b/app/Notifications/CheckoutAccessoryNotification.php
@@ -42,12 +42,12 @@ class CheckoutAccessoryNotification extends Notification
public function via()
{
$notifyBy = [];
- if (Setting::getSettings()->webhook_selected == 'google'){
+ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
- if (Setting::getSettings()->webhook_selected == 'microsoft'){
+ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}
diff --git a/app/Notifications/CheckoutAssetNotification.php b/app/Notifications/CheckoutAssetNotification.php
index 398be13844..6ed3707d64 100644
--- a/app/Notifications/CheckoutAssetNotification.php
+++ b/app/Notifications/CheckoutAssetNotification.php
@@ -62,12 +62,12 @@ class CheckoutAssetNotification extends Notification
public function via()
{
$notifyBy = [];
- if (Setting::getSettings()->webhook_selected == 'google'){
+ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
- if (Setting::getSettings()->webhook_selected == 'microsoft'){
+ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}
diff --git a/app/Notifications/CheckoutConsumableNotification.php b/app/Notifications/CheckoutConsumableNotification.php
index 0862d91537..71bf64f362 100644
--- a/app/Notifications/CheckoutConsumableNotification.php
+++ b/app/Notifications/CheckoutConsumableNotification.php
@@ -49,12 +49,12 @@ class CheckoutConsumableNotification extends Notification
public function via()
{
$notifyBy = [];
- if (Setting::getSettings()->webhook_selected == 'google'){
+ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class;
}
- if (Setting::getSettings()->webhook_selected == 'microsoft'){
+ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class;
}