Skip to content

Commit 6efd6e8

Browse files
committed
adds URL check before attempting MS teams notification
1 parent e5e6909 commit 6efd6e8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/Listeners/CheckoutableListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public function onCheckedOut($event)
9696
try {
9797
if ($this->shouldSendWebhookNotification()) {
9898
if ($this->newMicrosoftTeamsWebhookEnabled()) {
99+
if(!Str::contains(Setting::getSettings()->webhook_endpoint, 'workflows')){
100+
return redirect()->back()->with('warning',trans('admin/settings/message.webhook.webhook_fail'));
101+
}
99102
$message = $this->getCheckoutNotification($event)->toMicrosoftTeams();
100103
$notification = new TeamsNotification(Setting::getSettings()->webhook_endpoint);
101104
$notification->success()->sendMessage($message[0], $message[1]); // Send the message to Microsoft Teams

0 commit comments

Comments
 (0)