Files
coolify/app/Notifications/Channels/PushoverChannel.php
peaklabs-dev 92fec9582c fix: make pushover settings more clear
- Rename User to User Key
- Rename Token to API Token
- fix: helper and docs links
2024-12-11 19:18:39 +01:00

22 lines
691 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_key || ! $pushoverSettings->pushover_api_token) {
return;
}
SendMessageToPushoverJob::dispatch($message, $pushoverSettings->pushover_api_token, $pushoverSettings->pushover_user_key);
}
}