coolify/app/Notifications/Channels/WebhookChannel.php
Andras Bacsai 413dee5d8c feat: implement actual webhook delivery
Implement full webhook delivery functionality:
- Create SendWebhookJob to handle HTTP POST requests
- Update WebhookChannel to dispatch webhook jobs
- Configure retry logic (5 attempts, 10s backoff)
- Update Test notification payload with success/message structure

Webhook payload structure:
{
  "success": true/false,
  "message": "notification message",
  "event": "event_type",
  "url": "coolify_dashboard_url"
}

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 17:59:17 +02:00

25 lines
621 B
PHP

<?php
namespace App\Notifications\Channels;
use App\Jobs\SendWebhookJob;
use Illuminate\Notifications\Notification;
class WebhookChannel
{
/**
* Send the given notification.
*/
public function send(SendsWebhook $notifiable, Notification $notification): void
{
$webhookSettings = $notifiable->webhookNotificationSettings;
if (! $webhookSettings || ! $webhookSettings->isEnabled() || ! $webhookSettings->webhook_url) {
return;
}
$payload = $notification->toWebhook();
SendWebhookJob::dispatch($payload, $webhookSettings->webhook_url);
}
}