From 9fa71f847f4caafafc32a8185dcc48171c6498d5 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 1 Mar 2024 19:08:00 +0100 Subject: [PATCH] Refactor notification channels based on cloud environment --- app/Notifications/Application/DeploymentSuccess.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/Notifications/Application/DeploymentSuccess.php b/app/Notifications/Application/DeploymentSuccess.php index 8a409aa94..322df5cec 100644 --- a/app/Notifications/Application/DeploymentSuccess.php +++ b/app/Notifications/Application/DeploymentSuccess.php @@ -44,9 +44,11 @@ class DeploymentSuccess extends Notification implements ShouldQueue public function via(object $notifiable): array { $channels = setNotificationChannels($notifiable, 'deployments'); - $channels = array_filter($channels, function ($channel) { - return $channel !== 'App\Notifications\Channels\EmailChannel'; - }); + if (isCloud()) { + $channels = array_filter($channels, function ($channel) { + return $channel !== 'App\Notifications\Channels\EmailChannel'; + }); + } return $channels; }