feat: get Slack Webhook form new table

This commit is contained in:
peaklabs-dev
2024-12-09 17:36:32 +01:00
parent 6cab8b4598
commit dd9d10c717

View File

@@ -13,10 +13,12 @@ class SlackChannel
public function send(SendsSlack $notifiable, Notification $notification): void public function send(SendsSlack $notifiable, Notification $notification): void
{ {
$message = $notification->toSlack(); $message = $notification->toSlack();
$webhookUrl = $notifiable->routeNotificationForSlack(); $slackSettings = $notifiable->slackNotificationSettings;
if (! $webhookUrl) {
if (! $slackSettings || ! $slackSettings->isEnabled() || ! $slackSettings->slack_webhook_url) {
return; return;
} }
SendMessageToSlackJob::dispatch($message, $webhookUrl);
SendMessageToSlackJob::dispatch($message, $slackSettings->slack_webhook_url);
} }
} }