mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 01:20:31 +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:
@@ -113,4 +113,27 @@ class BackupSuccessWithS3Warning extends CustomEmailNotification
|
||||
color: SlackMessage::warningColor()
|
||||
);
|
||||
}
|
||||
|
||||
public function toWebhook(): array
|
||||
{
|
||||
$url = base_url().'/project/'.data_get($this->database, 'environment.project.uuid').'/environment/'.data_get($this->database, 'environment.uuid').'/database/'.$this->database->uuid;
|
||||
|
||||
$data = [
|
||||
'success' => true,
|
||||
'message' => 'Database backup succeeded locally, S3 upload failed',
|
||||
'event' => 'backup_success_with_s3_warning',
|
||||
'database_name' => $this->name,
|
||||
'database_uuid' => $this->database->uuid,
|
||||
'database_type' => $this->database_name,
|
||||
'frequency' => $this->frequency,
|
||||
's3_error' => $this->s3_error,
|
||||
'url' => $url,
|
||||
];
|
||||
|
||||
if ($this->s3_storage_url) {
|
||||
$data['s3_storage_url'] = $this->s3_storage_url;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user