Files
coolify/app/Notifications/Channels/PushoverChannel.php
Andras Bacsai 16c0cd10d8 rector: arrrrr
2025-01-07 14:52:08 +01:00

22 lines
697 B
PHP

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