Skip to content

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 + combobox selector, 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 set onlyAfterPayment: true so receipts fire only after deliverAfterPayment() runs on settled Payments checkouts.
  • 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).
Reuse branded Email Templates and PDF Templates across multiple forms from Setup -> Forms -> Templates.

Signed, SSRF-Hardened Webhooks (WebhookDefinition & WireHttpWebhookTransport)

Section titled “Signed, SSRF-Hardened Webhooks (WebhookDefinition & WireHttpWebhookTransport)”
  • Methods & Payloads: Supports POST and PUT with json, form_urlencoded, or multipart (with optional includeFiles) payloads, conditional sendIf expressions, custom headers, and errorKeywords response checks.
  • Cryptographic Signing: Signs payloads with HMAC X-Forms-Signature using the webhook’s signingSecret (masked automatically by FormSecretMasker on 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_RESOLVE IP pinning, and CURLOPT_PROXY => ''. Redacts query strings safely via WebhookUrlPolicy::redactUrlForLog() when logging to forms-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()).

Next steps