mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
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:
commit
112ddaf55b
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue