Notifications, Webhooks & PDFs
SubmissionPipeline orchestrates post-submit delivery with a per-submission advisory file lock (site/assets/cache/Forms/locks/delivery-*.lock) so concurrent requests never dispatch duplicate emails or webhooks. Delivery can run synchronously or asynchronously through ProcessFormDeliveryQueue.
Routed HTML5 Email Notifications (NotificationDefinition & FormsMailer)
Section titled “Routed HTML5 Email Notifications (NotificationDefinition & FormsMailer)”Each form supports unlimited notification rules configured in the Visual Builder or YAML:
- Recipient Modes (
recipientType):custom: Fixed staff addresses ([email protected]).field: Dynamic autoresponder sent to a submitted email field.routing: Conditional recipient mapping (recipientMapping+comboboxselector, e.g., route Gocek inquiries to[email protected]and Bodrum inquiries to[email protected]).
- Templates & Payment Gating: Bind reusable Email Templates (
emailTemplateSlug), attach generated PDFs (pdfTemplateSlug), and setonlyAfterPayment: trueso receipts fire only afterdeliverAfterPayment()runs on settledPaymentscheckouts. - Audience-Scoped Placeholders:
NotificationDispatcher::interpolate()resolves{source_page_title},{source_page_url},{source_page_path},{source_page_id},{source_page_template},{submission_admin_url},{submitted_ip},{user_agent},{submitted_user},{utm_data},{workflow_status},{workflow_status_label},{ab_test},{lang},{site_name},{site_url},{submitted_at},{page_data},{user_data}, and{admin_data}(restricted to non-autoresponder staff recipients). - Accessible HTML5 Wrapping:
FormsMailer::wrapHtmlDocument()wraps fragments in clean, accessible HTML5 email shells and strips header-injection characters. Tests can intercept all outbound mail with$forms->setMailInterceptor($closure).
Signed, SSRF-Hardened Webhooks (WebhookDefinition & WireHttpWebhookTransport)
Section titled “Signed, SSRF-Hardened Webhooks (WebhookDefinition & WireHttpWebhookTransport)”- Methods & Payloads: Supports
POSTandPUTwithjson,form_urlencoded, ormultipart(with optionalincludeFiles) payloads, conditionalsendIfexpressions, custom headers, anderrorKeywordsresponse checks. - Cryptographic Signing: Signs payloads with HMAC
X-Forms-Signatureusing the webhook’ssigningSecret(masked automatically byFormSecretMaskeron display and reset on cross-origin URL edits). - SSRF & DNS Pinning (
WebhookUrlPolicy&WireHttpWebhookTransport): Blocks private/reserved IPv4 and IPv6 CIDRs, trailing-dot hosts (localhost.,127.0.0.1.), header injection, and DNS rebinding via IDN punycode resolution,CURLOPT_RESOLVEIP pinning, andCURLOPT_PROXY => ''. Redacts query strings safely viaWebhookUrlPolicy::redactUrlForLog()when logging toforms-activity-logs. - Retries & Custom Transports: Retry failed deliveries with
$forms->retrySubmissionDelivery($form, $submissionId)or inject a mock transport via$forms->setWebhookTransport($transport).
Pure-PHP PDF 1.4 Generation (PdfDocumentGenerator)
Section titled “Pure-PHP PDF 1.4 Generation (PdfDocumentGenerator)”Create reusable PDF layouts under Setup -> Forms -> Templates -> PDF Templates (forms-pdf-templates) using {form_title}, {form_slug}, {submission_id}, {submitted_at}, and {field_name} placeholders. PdfDocumentGenerator renders standards-compliant PDF 1.4 binaries in pure PHP with zero external headless-browser dependencies, available both as email attachments and as one-click downloads in Setup -> Forms -> Submissions (ProcessForms::___executeSubmissionPdf()).