Merge pull request #14394 from marcusmoore/fixes/check-endpoint-is-set-for-checkout-in-notifications

Ensure Chat and Teams endpoints are not blank before attempting to send webhook on checkout and check in
This commit is contained in:
snipe 2024-03-08 08:44:52 +00:00 committed by GitHub
commit 112ddaf55b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 12 deletions

View file

@ -43,12 +43,12 @@ class CheckinAccessoryNotification extends Notification
public function via() public function via()
{ {
$notifyBy = []; $notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class; $notifyBy[] = GoogleChatChannel::class;
} }
if (Setting::getSettings()->webhook_selected == 'microsoft'){ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class; $notifyBy[] = MicrosoftTeamsChannel::class;
} }

View file

@ -51,12 +51,12 @@ class CheckinAssetNotification extends Notification
public function via() public function via()
{ {
$notifyBy = []; $notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class; $notifyBy[] = GoogleChatChannel::class;
} }
if (Setting::getSettings()->webhook_selected == 'microsoft'){ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class; $notifyBy[] = MicrosoftTeamsChannel::class;
} }

View file

@ -48,11 +48,11 @@ class CheckinLicenseSeatNotification extends Notification
{ {
$notifyBy = []; $notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class; $notifyBy[] = GoogleChatChannel::class;
} }
if (Setting::getSettings()->webhook_selected == 'microsoft'){ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class; $notifyBy[] = MicrosoftTeamsChannel::class;
} }

View file

@ -42,12 +42,12 @@ class CheckoutAccessoryNotification extends Notification
public function via() public function via()
{ {
$notifyBy = []; $notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class; $notifyBy[] = GoogleChatChannel::class;
} }
if (Setting::getSettings()->webhook_selected == 'microsoft'){ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class; $notifyBy[] = MicrosoftTeamsChannel::class;
} }

View file

@ -62,12 +62,12 @@ class CheckoutAssetNotification extends Notification
public function via() public function via()
{ {
$notifyBy = []; $notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class; $notifyBy[] = GoogleChatChannel::class;
} }
if (Setting::getSettings()->webhook_selected == 'microsoft'){ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class; $notifyBy[] = MicrosoftTeamsChannel::class;
} }

View file

@ -49,12 +49,12 @@ class CheckoutConsumableNotification extends Notification
public function via() public function via()
{ {
$notifyBy = []; $notifyBy = [];
if (Setting::getSettings()->webhook_selected == 'google'){ if (Setting::getSettings()->webhook_selected == 'google' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = GoogleChatChannel::class; $notifyBy[] = GoogleChatChannel::class;
} }
if (Setting::getSettings()->webhook_selected == 'microsoft'){ if (Setting::getSettings()->webhook_selected == 'microsoft' && Setting::getSettings()->webhook_endpoint) {
$notifyBy[] = MicrosoftTeamsChannel::class; $notifyBy[] = MicrosoftTeamsChannel::class;
} }