Skip to content

Custom Forms

Custom Forms lets you build forms with a visual editor, collect and manage submissions inside the admin, route them to email, push them to external systems through a signed webhook, and protect them from spam — all without writing code. It works on a standard Magento store and on a headless (Astro) storefront via GraphQL or REST.

Custom Forms in the admin — the forms list, submissions inbox, a submission, and the configuration screen

Magento

Open Source 2.4.9 GA (and later 2.4.x).

PHP

Tested on 8.4 and 8.5.

Storefront

Standard Luma/PWA and headless (Astro) via GraphQL/REST.

PDF (optional)

Bundled mpdf/mpdf for PDF export & PDF email attachments.
  1. Go to Content → Custom Forms → Forms and click Create New Form.

  2. On the General tab, enter a Form Title and a Form Code (lowercase, numbers and underscores — used for embedding).

  3. Open the Form Builder tab and add your fields.

  4. Set the Submit Button Text and Success Message on the Content tab.

  5. Click Save Form.

  6. Embed it on a page — or it’s instantly available to a headless storefront by its code.


Before building forms, set the store-wide defaults at Stores → Configuration → AgenticEcom · Sales, Customers & Marketing → Custom Forms. Every setting here is a default that individual forms can build on; spam, reCAPTCHA, email and webhook all live here. The working screens are under Content → Custom Forms (Forms, Submitted Data, Autoresponder Templates, Configuration).

The Custom Forms configuration section with all nine setting groups

  • Enable Custom Forms — master on/off switch for the whole module.

Content → Custom Forms → Forms lists every form you’ve built. Each row shows the ID, Form Name, Code, whether it’s Active, whether AI Spam Protection is on, and the Created date. Use the row’s Select → Edit / Delete, or the Actions menu for bulk operations. Create New Form (top-right) starts a new one.

The Custom Forms grid listing several forms a merchant might build

A form-edit screen has five tabs down the left under FORM CONFIGURATION: General, Notifications, Content, Form Builder and Embedding.

The General tab — enable, title, code, store views and customer groups

  • Enable Form — turn this individual form on or off.
  • Form Title — shown in the grid and (optionally) above the form.
  • Form Code — the unique identifier used for embedding. Lowercase letters, numbers and underscores only.
  • Store Views — restrict the form to specific store views (leave to show everywhere).
  • Customer Groups — restrict the form to specific customer groups.

The Content tab — submit button text, success message, popup mode and per-form CAPTCHA

  • Submit Button Text — the call-to-action on the button (e.g. Send message, Request a Quote).
  • Success Message — shown after a successful submission. Set / AJAX-style success without a page reload.
  • Show as Popup — render the form inside a modal triggered by a button instead of inline.
  • Popup Button Text — the label of that trigger button.
  • Enable CAPTCHA — turn on reCAPTCHA v3 verification for this form (needs keys in global config).

The Notifications tab — per-form admin email and autoresponder overrides

  • Send Email to Admin on Submission — toggle admin notifications for this form.
  • Notification Recipients — per-form recipients (comma-separated, no spaces). Overrides the global default.
  • Email Template — leave on Use Default, or pick a custom one. You can manage reusable form-email templates in the module’s own Content → Custom Forms → Autoresponder Templates screen (or use a core Magento template from Marketing → Email Templates).
  • Send Auto-Reply to Submitter — per-form autoresponder. Requires an email field in the form so the module knows where to reply.

The builder has a Form Layout canvas on the left and a Field Types palette on the right. Click a palette field to append it, or drag it onto the canvas. Every field has a drag handle to reorder, plus Duplicate, Edit and Delete actions.

The drag-and-drop form builder: canvas on the left, field-type palette on the right

  • Text Input — short text (names, references).
  • Email — validated email address (used by the autoresponder).
  • Number — numeric-only input.
  • Phone — telephone number.
  • URL — validated web address.
  • Password — masked input.
  • Text Area — long text (messages, descriptions, reviews).
  • Address Block — a ready-made group: address lines, city, county, postcode, country.

Click the Edit (pencil) on a field to configure it:

The field settings panel — label, name, placeholder, required, validation, width and conditional logic

  • Field Label — shown above the field.
  • Field Name — the data key (lowercase, no spaces). This is the key you’ll see in submissions and the API payload.
  • Placeholder — hint text inside the input.
  • Required — make the field mandatory (enforced in the browser and server-side).
  • CSS Class — a custom class for styling.
  • ValidationNone, Email, URL, Alphanumeric or Numeric (also enforced server-side).
  • Column Width — 100 / 75 / 66 / 50 / 33 / 25%. Fields whose widths add up to 100% sit side by side on one row, and stack on mobile.
  • Conditional Logic — show or hide the field when other fields match rules (AND/OR).

Heading and Paragraph fields carry a full WYSIWYG editor in their Content setting. Format with the toolbar, or click <> Source code to paste/edit raw HTML. Whatever you enter renders formatted on the storefront — type plain text and it’s wrapped for you; paste HTML and it’s sanitised and rendered.

A File Upload field accepts these types by default, up to 5 MB each:

jpg, jpeg, png, gif, webp, bmp, heic · pdf, doc, docx, xls, xlsx, ppt, pptx · txt, csv, rtf, odt, ods, zip

After the first save, the form’s Embedding tab shows three ready-to-paste snippets:

The Embedding tab — CMS block code, Astro component tag and a direct URL

<div class="agentic-custom-form agentic-form--contact_us"></div>

Paste into any CMS block or page (Show/Hide Editor → HTML). The storefront renders the live form in its place.


Open Content → Custom Forms → Submitted Data.

  • The grid lists every submission with Status (New, Read, Replied, Spam), Spam Score, email, name, IP and date — filter, search and sort.
  • Select → View opens the full submission with every field value (uploaded files appear as download links) and an inline reply form. Opening a New submission marks it Read.
  • Reply emails the submitter (using your Reply Form template) and marks it Replied.
  • Actions (mass): set status, mark as spam, or delete in bulk.
  • Export to CSV — a spreadsheet of all submissions (UTF-8, Excel-friendly).
  • Export to PDF — a branded PDF (uses the bundled mpdf library). Per-form export buttons live on the form-edit action bar.

Submission lifecycle: storefront to validation, spam scoring, storage, then email, autoresponder and webhook

One server pipeline handles both the standard storefront and the headless GraphQL/REST endpoints, so validation, spam scoring and notifications behave identically everywhere.

  • Admin Notification — email your team on every genuine submission. Recipients, sender and template are set globally and can be overridden per form; optionally attach a PDF.
  • Autoresponder — automatically thank the submitter; sends to the form’s email field.
  • Reply Form — the template, sender and BCC used when you reply from the admin.

You can pull any field’s value into your email templates. In a template (an Autoresponder Template under Content → Custom Forms → Autoresponder Templates, or a core AgenticEcom Custom Form template under Marketing → Email Templates), reference a field by its Field Name — for example a field named order_ref:

Reference supplied: {{var data.order_ref}}

Every submitted field is available on the data object by its field name, so admin and autoresponder emails can be fully personalised.

  1. Honeypot — a hidden field bots fill but humans don’t; a filled honeypot is treated as spam.

  2. Blocked keywords — comma-separated words that flag a submission.

  3. Heuristics — built-in checks (excess links, known spam phrases, all-caps, mixed scripts).

  4. AI scoring (Google Gemini) — an optional second opinion for ambiguous submissions, using your own Google AI key.

  5. reCAPTCHA v3 — set your keys, enable CAPTCHA on a form, and submissions are verified server-side.

Push every new submission as JSON to an external URL (Zapier, Make, n8n, a CRM, or your own endpoint). Enable it, set the URL, and optionally a signing secret.

  • GDPR Consent — add a consent checkbox with custom text.
  • Date Format — how dates appear in submissions/exports.
  • File Upload Links Lifetime — expire uploaded-file links after N days (0 = never).
  • Submission Retention — auto-delete submissions older than N days (0 = keep forever).

For a decoupled (Astro) storefront, forms are delivered and submitted over GraphQL (a REST equivalent is also available).

# Fetch a form definition
{ customForm(code: "contact_us") {
form_id name code is_active enable_captcha
submit_button_text success_message recaptcha_site_key fields_json
} }
# Submit a form
mutation {
submitCustomForm(
form_code: "contact_us"
data: "{\"name\":\"Jane\",\"email\":\"jane@example.com\",\"message\":\"Hello\"}"
recaptcha_token: "<v3 token, when CAPTCHA is enabled>"
) { success message submission_id }
}

The submit path runs server-side validation, spam scoring and reCAPTCHA, stores the submission, and triggers the admin email, autoresponder and webhook — identically for GraphQL and REST.

These add functionality but aren’t required to run the module:

  • mpdf/mpdf — enables Export to PDF and Attach Submission PDF on notification emails.
Do I need a developer to add a form to a page?

No. Copy the CMS block code from the Embedding tab and paste it into any CMS page or block (in HTML mode). On a headless storefront, drop the <CustomForm code="…" /> tag onto an Astro page.

How does the autoresponder know who to reply to?

It reads the form’s email field. Add an Email field to the form (and enable the autoresponder globally or per-form) and replies go to whatever the submitter entered.

Is the form secure against bots and spam?

Yes — five layers: a honeypot, a blocked-keyword list, built-in heuristics, optional AI scoring, and reCAPTCHA v3 (which fails closed). Submissions over the spam threshold are flagged and skip all notifications, or can be auto-rejected.

What about secure development practices?

All input is validated and spam-scored server-side (never trusting the browser); uploaded files are restricted to a safe-type allowlist with a size cap and stored outside the database; secret keys (reCAPTCHA, AI, webhook) are stored encrypted; and the webhook payload is HMAC-signed. The module is verified clean on PHP 8.4 and 8.5.

Can I personalise the notification emails?

Yes. Any field value is available in the email template as {{var data.<field_name>}} — see Custom values in notification emails.

Stores → Configuration → AgenticEcom · Sales, Customers & Marketing → Custom Forms

GroupKey settings
GeneralEnable Custom Forms
Spam ProtectionHoneypot, score threshold, auto-reject, blocked keywords, AI scoring + Google AI key + model
Google reCAPTCHA v3Site key, secret key, minimum score
Admin NotificationEnable, recipients, sender, template, attach PDF
Reply Form ConfigurationSender, template, BCC
AutoresponderEnable, sender, template
Webhook / ZapierEnable, URL, signing secret
GDPR ConsentEnable, consent text
AdvancedDate format, file-link lifetime, submission retention