Platform Guide

Wix Integration

Send a custom HTML form on Wix to your email

Last updated

To use your own HTML form on a Wix site, paste it into an Embed HTML element and point it at https://api.staticforms.dev/submit with your form's API key in an apiKey field. Static Forms emails each submission to you. Wix shows embedded code in a frame, so the form below sends with a few lines of JavaScript and shows its result inside the frame. It works on the free plan.

Steps

1

Add an Embed HTML element

In the Wix Editor, add an Embed HTML element (under Embed Code) where the form should appear.

2

Paste the form

Choose Code, paste the snippet below, and replace YOUR_API_KEY with the key from your form's General tab.

3

Size and publish

Resize the element so the whole form and its status line fit, then publish and send a test message.

Form code

HTML

Domain restriction

The embed runs inside a frame that Wix serves from its own domain, not your site's. If you turn on domain restriction (Starter and up), a list that names only your own domain will reject these submissions, because the request comes from the frame's domain.

For a CAPTCHA (reCAPTCHA v2 on Free; Turnstile, hCaptcha and ALTCHA from Starter) or file uploads (Starter and up), see the HTML guide; the field names are the same.

FAQ

Does this work on the free plan?

Yes. The snippet only uses Free plan features: 250 submissions every 30 days, 1 form endpoint, email delivery, the built-in spam filter, a honeypot field and reCAPTCHA v2. No credit card is needed.

How do I keep spam out?

Every submission is checked by the built-in spam filter on every plan. The snippet adds a hidden honeypot field (any field whose name contains "honeypot"); bots fill it in and those submissions are dropped. reCAPTCHA v2 is available on Free. Cloudflare Turnstile, hCaptcha, ALTCHA and reCAPTCHA v3 are available from the Starter plan.

Is it safe to put the API key in my HTML?

Yes. The form API key is meant to be public. It cannot read your submissions or sign in to your dashboard. From the Starter plan you can also restrict submissions to your own domains.

Why not redirect to a thank-you page?

Wix shows embedded code in a frame, so a redirect would load the thank-you page inside the frame. Showing the result in the form, as the snippet does, avoids that.