⚠️ This is a demo instance for inled.es. To use it in your projects, download the code here and deploy your own instance.

Mailform Workers

Secure, private, and integrable contact form for your Cloudflare Workers projects.

View on GitHub

Security

Native validation with Cloudflare Turnstile to prevent spam without compromising user privacy.

Privacy

Your emails and secret keys never leave Cloudflare's infrastructure. No trackers or external servers.

Customizable

Inject the form into any website and style it with your own CSS using semantic classes.

Deploy in 5 minutes

1. Clone the repository

git clone https://github.com/InledGroup/mailform
cd mailform
npm install

2. Interactive Setup

Run our setup script to securely link your Turnstile Site Key and destination email:

./setup.sh

3. Deploy to Cloudflare

Publish your Worker to your Cloudflare account with a single command:

npm run deploy

How to Integrate the Widget

1. Prepare the container

Add a <div> with the ID "mailform" in the part of your website where you want the form to appear.

<div id="mailform"></div>

2. Load the Widget

Add the script pointing to your Mailform instance at the end of the body.

<script src="https://mailform.inled.es/widget.js" defer></script>

3. Style it (CSS)

Customize the form from your own website's CSS using the available classes.

.mailform-button {
    background-color: #F38020;
    border-radius: 8px;
}
.mailform-input {
    border: 2px solid #333;
}

4. Authorize your Domain (Important)

For the Turnstile captcha to work, you must add your website's domain in the Cloudflare panel:

  • Go to Turnstile in your Cloudflare Dashboard.
  • Edit your Widget and look for Hostname Management.
  • Add the domain where you have integrated the form.

Live Demo

The following form is being dynamically injected using /widget.js and has custom styles from this very page.