feat: always sent notifications

This commit is contained in:
peaklabs-dev
2024-12-09 17:00:07 +01:00
parent b6500142c4
commit a849bfdc3e
3 changed files with 7 additions and 72 deletions

View File

@@ -2,9 +2,6 @@
namespace App\Notifications\Internal;
use App\Notifications\Channels\DiscordChannel;
use App\Notifications\Channels\TelegramChannel;
use App\Notifications\Channels\SlackChannel;
use App\Notifications\Dto\DiscordMessage;
use App\Notifications\Dto\SlackMessage;
use Illuminate\Bus\Queueable;
@@ -24,22 +21,7 @@ class GeneralNotification extends Notification implements ShouldQueue
public function via(object $notifiable): array
{
$channels = [];
$isDiscordEnabled = data_get($notifiable, 'discord_enabled');
$isTelegramEnabled = data_get($notifiable, 'telegram_enabled');
$isSlackEnabled = data_get($notifiable, 'slack_enabled');
if ($isDiscordEnabled) {
$channels[] = DiscordChannel::class;
}
if ($isTelegramEnabled) {
$channels[] = TelegramChannel::class;
}
if ($isSlackEnabled) {
$channels[] = SlackChannel::class;
}
return $channels;
return $notifiable->getEnabledChannels('general');
}
public function toDiscord(): DiscordMessage