type = $type; } public function via(object $notifiable): array { $channels = []; $isSmtp = $this->type === 'smtp' || is_null($this->type); $isDiscord = $this->type === 'discord' || is_null($this->type); $isEmailEnabled = data_get($notifiable, 'smtp.enabled'); $isDiscordEnabled = data_get($notifiable, 'discord.enabled'); if ($isEmailEnabled && $isSmtp) { $channels[] = EmailChannel::class; } if ($isDiscordEnabled && $isDiscord) { $channels[] = DiscordChannel::class; } return $channels; } public function toMail(): MailMessage { $mail = new MailMessage(); $mail->subject("Coolify Test Notification"); $mail->view('emails.test'); return $mail; } public function toDiscord(): string { $message = 'This is a test Discord notification from Coolify.'; $message .= "\n\n"; $message .= '[Go to your dashboard](' . base_url() . ')'; return $message; } }