prepare("INSERT INTO settings (setting_key, setting_value) VALUES (:key, :value) ON DUPLICATE KEY UPDATE setting_value = :value"); foreach ($allowed_settings as $key) { if (isset($_POST[$key])) { $stmt->execute([':key' => $key, ':value' => $_POST[$key]]); } } $success_message = "Settings saved successfully!"; } // Handle token regeneration if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['regenerate_token'])) { $new_token = bin2hex(random_bytes(16)); $stmt = $pdo->prepare("INSERT INTO settings (setting_key, setting_value) VALUES ('webhook_token', :token) ON DUPLICATE KEY UPDATE setting_value = :token"); $stmt->execute([':token' => $new_token]); $success_message = "New webhook token generated successfully!"; } // Fetch all settings from the database $stmt = $pdo->query("SELECT * FROM settings"); $db_settings = $stmt->fetchAll(PDO::FETCH_KEY_PAIR); // Merge with defaults to ensure all keys exist $settings = array_merge( array_fill_keys($allowed_settings, ''), $db_settings ); // Generate a token if it doesn't exist if (empty($settings['webhook_token'])) { $settings['webhook_token'] = bin2hex(random_bytes(16)); $stmt = $pdo->prepare("INSERT INTO settings (setting_key, setting_value) VALUES ('webhook_token', :token) ON DUPLICATE KEY UPDATE setting_value = :token"); $stmt->execute([':token' => $settings['webhook_token']]); } // Construct the full webhook URL $scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http"; $host = $_SERVER['HTTP_HOST']; $incoming_webhook_url = sprintf('%s://%s/webhook_receiver.php?token=%s', $scheme, $host, $settings['webhook_token']); ?>

Settings

View Webhook Documentation
Outgoing Webhooks (See Docs)

Configure webhooks to send notifications to external services based on events in the application. Enter the full URL for each endpoint.

This webhook will be triggered when a new post is added to the scheduler.
This webhook will be triggered when a scheduled post is successfully sent. (Not yet implemented)
This webhook will be triggered when a new channel is added to the system. (Not yet implemented)
Incoming Webhook URL (See Docs)

Use this URL in your external services (like n8n) to send data back to this application.