Validate form submissions and action configuration, execute finishers with submission context, and return JSON success or error responses. Add configurable confirmation emails to submitters and report failed submissions in the form UI. Harden database and admin email finishers, and add submission handler and confirmation email checks.
11 lines
344 B
PHP
11 lines
344 B
PHP
<?php
|
|
|
|
$handler = new \Plugi\Extensions\Form\SubmissionHandler();
|
|
$result = $handler->handle($_GET['id'] ?? null, file_get_contents('php://input') ?: '');
|
|
|
|
http_response_code($result['status']);
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
echo json_encode($result['body'], JSON_UNESCAPED_UNICODE | JSON_INVALID_UTF8_SUBSTITUTE);
|
|
|
|
|