coolify/app/Notifications/Channels/PushoverChannel.php

22 lines
691 B
PHP
Raw Permalink Normal View History

2024-12-11 14:54:11 +00:00
<?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;
2024-12-11 14:54:11 +00:00
if (! $pushoverSettings || ! $pushoverSettings->isEnabled() || ! $pushoverSettings->pushover_user_key || ! $pushoverSettings->pushover_api_token) {
return;
}
2024-12-11 14:54:11 +00:00
SendMessageToPushoverJob::dispatch($message, $pushoverSettings->pushover_api_token, $pushoverSettings->pushover_user_key);
}
2024-12-11 14:54:11 +00:00
}