mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-16 09:42:29 -04:00
Co-authored-by: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Co-authored-by: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: rosslh <ross@rosshill.ca>
30 lines
844 B
PHP
30 lines
844 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();
|
|
|
|
$discordSettings = $notifiable->discordNotificationSettings;
|
|
|
|
if (! $discordSettings || ! $discordSettings->isEnabled() || ! $discordSettings->discord_webhook_url) {
|
|
return;
|
|
}
|
|
|
|
if (! $discordSettings->discord_ping_enabled) {
|
|
$message->isCritical = false;
|
|
}
|
|
|
|
SendMessageToDiscordJob::dispatch($message, $discordSettings->discord_webhook_url, data_get($notification, 'isTestNotification', false) ? null : $discordSettings);
|
|
}
|
|
}
|