coolify/app/Notifications/Channels/DiscordChannel.php
Andras Bacsai 7dc65dfd79
Some checks are pending
Staging Build / amd64 (push) Waiting to run
Staging Build / aarch64 (push) Waiting to run
Staging Build / merge-manifest (push) Blocked by required conditions
fix: make sure important jobs/actions are running on high prio queue
2024-11-22 11:16:01 +01:00

23 lines
540 B
PHP

<?php
namespace App\Notifications\Channels;
use App\Jobs\SendMessageToDiscordJob;
use Illuminate\Notifications\Notification;
class DiscordChannel
{
/**
* Send the given notification.
*/
public function send(SendsDiscord $notifiable, Notification $notification): void
{
$message = $notification->toDiscord();
$webhookUrl = $notifiable->routeNotificationForDiscord();
if (! $webhookUrl) {
return;
}
SendMessageToDiscordJob::dispatch($message, $webhookUrl);
}
}