=== Static Forms – Form Backend & Spam Filtering ===
Contributors: hussainanjar
Tags: contact form, form submission, elementor, contact form 7, form backend
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send WordPress form submissions to Static Forms — email delivery, spam filtering, and integrations with Slack, Mailchimp, Notion, and more.

== Description ==

[Static Forms](https://www.staticforms.dev) is a form backend for static websites and WordPress. It handles email delivery, spam filtering, webhooks, and integrations with Slack, Google Sheets, Notion, Mailchimp, and more — so you don't have to configure SMTP or maintain a mail server.

Connect your account once, then drop any of your forms onto a page with the **Static Forms** block or a shortcode — the exact form you built in your dashboard, with its validation, file uploads, and CAPTCHA. The plugin also routes submissions from the form builders you already use (Elementor Pro, Contact Form 7) to the same inbox.

**Why use this plugin?**

* **Connect once, embed anything** — add your account API key, then pick any of your forms from a dropdown in the block editor.
* **Multiple forms, one account** — run a different form on every page; each lands in its own Static Forms inbox.

* **One inbox for all your sites** — WordPress, static HTML, React, Astro — all submissions land in the same place.
* **Migrate without breaking forms** — moving from WordPress to a static site? Your Static Forms endpoint stays the same. Zero form downtime.
* **Works with the form builders you already use** — no need to switch to a new form builder.
* **Reliable email delivery** — Static Forms uses dedicated sending infrastructure, so emails don't land in spam.

**Ways to add a form**

* **Static Forms block** — insert the block, pick a form from the dropdown, publish. The form you built in your dashboard renders live on the page.
* **Shortcode** — `[staticforms form="FORM_API_KEY"]` embeds the same builder form anywhere shortcodes work. `[staticforms]` (no `form`) still renders the original plain HTML contact form, no builder required.
* **Elementor Pro** — a native "Static Forms" entry appears in the form widget's Actions After Submit. Configure it per-form with an optional API key override.
* **Contact Form 7** — forward all CF7 submissions to Static Forms with one checkbox. Works even when `wp_mail()` is unreliable.

**Static Forms features (available after connecting)**

* Email delivery to your inbox on every submission
* Spam filtering
* Webhooks
* Integrations: Slack, Google Sheets, Notion, Mailchimp, Telegram, Discord, and more
* Submission history dashboard
* Domain allowlist to block unwanted senders

A free Static Forms account is required. Sign up at [staticforms.dev](https://www.staticforms.dev).

= Third-Party Service =

This plugin transmits form submission data (field values, sender name, email address, and message) to the Static Forms API (`https://api.staticforms.dev`), a third-party service operated by Static Forms.

Data is sent when a visitor submits a form on your site. No data is sent during plugin activation, settings changes, or admin actions — only on front-end form submit.

* [Static Forms Terms of Service](https://www.staticforms.dev/terms)
* [Static Forms Privacy Policy](https://www.staticforms.dev/privacy-policy)

By using this plugin you agree to the Static Forms Terms of Service and Privacy Policy.

== Installation ==

1. Upload the plugin ZIP via **Plugins → Add New → Upload Plugin**, then activate it.
2. Generate an **account API key** under **Account** in your Static Forms dashboard ([staticforms.dev/app/account](https://www.staticforms.dev/app/account)). This is a private key (it can list every form on your account), separate from the public per-form keys — keep it secret. It is a Pro feature.
3. Go to **Settings → Static Forms**, paste the account API key, and save. The page confirms the connection and lists your forms.
4. Add a form to a page:

**Static Forms block (recommended)**
In the block editor, add the **Static Forms** block and choose a form from the dropdown. Publish the page and the form renders live.

**Shortcode**
Copy a form's shortcode from Settings → Static Forms, or write it by hand:

`[staticforms form="FORM_API_KEY"]`

The original ready-made contact form is still available with no `form` attribute:

`[staticforms key="YOUR_API_KEY" redirect="https://yoursite.com/thank-you"]`

**Elementor Pro**
Edit your form widget → Actions After Submit → add **Static Forms**. Optionally enter a per-form API key to override the global setting.

**Contact Form 7**
Tick **"Forward Contact Form 7 submissions to Static Forms"** in Settings → Static Forms. Submissions from all CF7 forms on the site will be forwarded automatically.

**Shortcode (no form builder needed)**
Add the `[staticforms]` shortcode to any page or post:

`[staticforms key="YOUR_API_KEY" redirect="https://yoursite.com/thank-you"]`

Available shortcode attributes:
* `form` — embed a form built in your dashboard, by its per-form API key (takes priority over the attributes below)
* `key` — API key for the plain HTML form (overrides the global setting)
* `redirect` — URL to redirect to after a successful submission
* `subject` — custom email subject line
* `button` — button label (default: "Send Message")

== Frequently Asked Questions ==

= Do I need an Elementor Pro licence? =

No. Elementor Pro gets a native form action, but Contact Form 7 forwarding and the `[staticforms]` shortcode work without any page builder.

= Do I need a paid Static Forms plan? =

No. The free plan includes 100 submissions per month. Paid plans remove limits and unlock additional integrations.

= What happens when I migrate away from WordPress? =

Your Static Forms endpoint and inbox stay the same. Point the form on your new static site at `https://api.staticforms.dev/submit` and submissions keep flowing — no inbox reconfiguration needed.

= Is my API key exposed to visitors? =

There are two kinds of key, and only the public one ever reaches the browser:

* **Account API key** (private, `sfacct...`) — used only to list your forms for the block picker. It stays server-side: the plugin sends it from WordPress to Static Forms and never prints it into a page. Treat it like a password; rotate it from your dashboard if it leaks.
* **Per-form key** (public, `sf_...`) — what the block and `[staticforms form="..."]` embed render into the page, and what Contact Form 7 / Elementor forward. These are designed to be public, the same model as any static site using Static Forms, and are protected by domain allowlists and spam filtering.

Elementor Pro and Contact Form 7 submissions are forwarded server-to-server, so even the per-form key never reaches the browser there.

= How do I restrict which domains can submit to my API key? =

Log in to your Static Forms dashboard and add your domain to the allowlist for that API key. Submissions from other domains will be rejected. The plugin sends your site's address with each submission, so allowlisting your WordPress domain works for Elementor Pro, Contact Form 7, and the shortcode.

= I have CAPTCHA enabled on my form and submissions are rejected =

Elementor Pro and Contact Form 7 submissions are forwarded server-to-server and cannot carry a CAPTCHA token, so a Static Forms form that requires CAPTCHA will reject them. Turn CAPTCHA off for the API key used by the plugin and rely on the domain allowlist plus built-in spam filtering instead. The `[staticforms]` shortcode renders a browser form, so it can use CAPTCHA normally.

= Where do I see my submissions? =

In your Static Forms dashboard at [staticforms.dev/dashboard](https://www.staticforms.dev/dashboard). You also receive an email for each submission.

== Screenshots ==

1. Settings page — paste your global API key once and all integrations pick it up.
2. Elementor Pro — "Static Forms" action in the form widget's Actions After Submit panel.
3. Contact Form 7 — one-click forwarding toggle in plugin settings.
4. Shortcode output — a clean, ready-to-use contact form with no page builder required.

== Changelog ==

= 2.0.0 =
* New: connect your account once and pick any of your forms from a dropdown.
* New: **Static Forms** block — embeds a form built in your dashboard, rendered live with its validation, file uploads, and CAPTCHA.
* New: `[staticforms form="..."]` shortcode mode to embed a builder form anywhere.
* New: redesigned settings page with connection status and a copy-ready snippet for each form.
* Existing Elementor Pro, Contact Form 7 forwarding, and the plain `[staticforms]` contact form are unchanged.

= 1.0.0 =
* Initial release: Elementor Pro form action, Contact Form 7 forwarding, `[staticforms]` shortcode, global settings page.

== Upgrade Notice ==

= 2.0.0 =
Adds the Static Forms block and multi-form embedding. Your existing forms and settings keep working — no action required.

= 1.0.0 =
Initial release. No upgrade steps required.
