Files
coolify/app/Notifications/Channels/PushoverChannel.php
2024-12-11 18:13:16 +01:00

22 lines
643 B
PHP

<?php
namespace App\Notifications\Channels;
use App\Jobs\SendMessageToPushoverJob;
use Illuminate\Notifications\Notification;
class PushoverChannel
{
public function send(SendsPushover $notifiable, Notification $notification): void
{
$message = $notification->toPushover();
$pushoverSettings = $notifiable->pushoverNotificationSettings;
if (! $pushoverSettings || ! $pushoverSettings->isEnabled() || ! $pushoverSettings->pushover_user || ! $pushoverSettings->pushover_token) {
return;
}
SendMessageToPushoverJob::dispatch($message, $pushoverSettings->pushover_token, $pushoverSettings->pushover_user);
}
}