Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: only send internal notifcations to enabled channels

Andras Bacsaiec4234e2434b
diff --git a/app/Notifications/Internal/GeneralNotification.php b/app/Notifications/Internal/GeneralNotification.php
index 0241756222..d00432ca98 100644
--- a/app/Notifications/Internal/GeneralNotification.php
+++ b/app/Notifications/Internal/GeneralNotification.php
@@ -19,7 +19,17 @@ class GeneralNotification extends Notification implements ShouldQueue
public function via(object $notifiable): array
{
- return [TelegramChannel::class, DiscordChannel::class];
+ $channels = [];
+ $isDiscordEnabled = data_get($notifiable, 'discord_enabled');
+ $isTelegramEnabled = data_get($notifiable, 'telegram_enabled');
+
+ if ($isDiscordEnabled) {
+ $channels[] = DiscordChannel::class;
+ }
+ if ($isTelegramEnabled) {
+ $channels[] = TelegramChannel::class;
+ }
+ return $channels;
}
public function toDiscord(): string