mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 03:20:26 +00:00
feat: add UUIDs and URLs to webhook notifications
- Add resource UUIDs (application_uuid, database_uuid, server_uuid, task_uuid) to all webhook notifications - Standardize URL field naming from various formats (resource_url, task_url, server_url) to consistent 'url' field - Include parent resource UUIDs for scheduled tasks (application_uuid or service_uuid) - Add direct URLs to Coolify resources for all notification types - Update UI to show "Webhook URL (POST)" label for clarity This enables webhook consumers to: - Uniquely identify resources using UUIDs used throughout Coolify UI - Directly link back to Coolify resource pages via the url field 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -114,4 +114,28 @@ class TaskFailed extends CustomEmailNotification
|
||||
color: SlackMessage::errorColor()
|
||||
);
|
||||
}
|
||||
|
||||
public function toWebhook(): array
|
||||
{
|
||||
$data = [
|
||||
'success' => false,
|
||||
'message' => 'Scheduled task failed',
|
||||
'event' => 'task_failed',
|
||||
'task_name' => $this->task->name,
|
||||
'task_uuid' => $this->task->uuid,
|
||||
'output' => $this->output,
|
||||
];
|
||||
|
||||
if ($this->task->application) {
|
||||
$data['application_uuid'] = $this->task->application->uuid;
|
||||
} elseif ($this->task->service) {
|
||||
$data['service_uuid'] = $this->task->service->uuid;
|
||||
}
|
||||
|
||||
if ($this->url) {
|
||||
$data['url'] = $this->url;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,4 +105,28 @@ class TaskSuccess extends CustomEmailNotification
|
||||
color: SlackMessage::successColor()
|
||||
);
|
||||
}
|
||||
|
||||
public function toWebhook(): array
|
||||
{
|
||||
$data = [
|
||||
'success' => true,
|
||||
'message' => 'Scheduled task succeeded',
|
||||
'event' => 'task_success',
|
||||
'task_name' => $this->task->name,
|
||||
'task_uuid' => $this->task->uuid,
|
||||
'output' => $this->output,
|
||||
];
|
||||
|
||||
if ($this->task->application) {
|
||||
$data['application_uuid'] = $this->task->application->uuid;
|
||||
} elseif ($this->task->service) {
|
||||
$data['service_uuid'] = $this->task->service->uuid;
|
||||
}
|
||||
|
||||
if ($this->url) {
|
||||
$data['url'] = $this->url;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user