<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Formkove]]></title><description><![CDATA[Formkove]]></description><link>https://formkove.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Dec 2026 21:55:55 GMT</lastBuildDate><atom:link href="https://formkove.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to send a contact form to Telegram (bot token and chat ID)]]></title><description><![CDATA[A Telegram bot can post every contact form message to your phone, a group or a channel. You need two things from Telegram, a bot token and a chat ID, and…]]></description><link>https://formkove.hashnode.dev/contact-form-to-telegram</link><guid isPermaLink="true">https://formkove.hashnode.dev/contact-form-to-telegram</guid><category><![CDATA[webdev]]></category><category><![CDATA[telegram]]></category><category><![CDATA[PHP]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Fri, 04 Dec 2026 03:42:58 GMT</pubDate><content:encoded><![CDATA[<p>A Telegram bot can post every contact form message to your phone, a group or a channel. You need two things from Telegram, a <strong>bot token</strong> and a <strong>chat ID</strong>, and something on a server that holds the token, because anyone who has it can send messages as your bot. It can't go in your page's JavaScript.</p>
<p>This guide gets the token and chat ID first, since you need them either way. Then there are two ways to send the messages:</p>
<ol>
<li><strong>A PHP script</strong> next to your site, if you're on shared hosting (cPanel, Hostinger, Bluehost and the like). It's one file and needs no build step.</li>
<li><strong>A form backend</strong>, if you'd rather not run anything and want spam filtering and storage too.</li>
</ol>
<h2>Get the bot token and chat ID</h2>
<h3>The token</h3>
<p>In Telegram, message <a href="https://t.me/BotFather">@BotFather</a>, send <code>/newbot</code>, and pick a name and a username. BotFather replies with a token like <code>123456789:AAH...</code>. Copy all of it, including the numbers before the colon.</p>
<h3>The chat ID</h3>
<p>First put the bot where the messages should go:</p>
<ul>
<li><strong>Just you</strong>: open your bot and press <strong>Start</strong>. A bot can't message someone who never started it.</li>
<li><strong>A group</strong>: add the bot to the group, then send <code>/start@your_bot_username</code> there. Bots in groups only see commands and replies meant for them by default, so a plain message won't show up in the next step.</li>
<li><strong>A channel</strong>: add the bot as an administrator that can post messages, then post anything in the channel.</li>
</ul>
<p>Then open this in your browser, with your token in place of <code>&lt;token&gt;</code>:</p>
<pre><code>https://api.telegram.org/bot&lt;token&gt;/getUpdates
</code></pre>
<p>Find <code>"chat":{"id":</code> in the response and copy the number. Private chats have a positive ID. Groups and channels start with a minus sign, like <code>-1001234567890</code>, and the minus is part of the ID. For a public channel you can also use its username, like <code>@yourchannel</code>.</p>
<p>If you see <code>"result":[]</code>, Telegram has nothing new for the bot yet (it keeps updates for 24 hours). Send the message or command again and reload.</p>
<h2>1. A PHP script on shared hosting</h2>
<h3>The form</h3>
<pre><code class="language-html">&lt;form action="/contact.php" method="POST"&gt;
  &lt;input name="name" placeholder="Name" required&gt;
  &lt;input name="email" type="email" placeholder="Email" required&gt;
  &lt;textarea name="message" placeholder="Message" required&gt;&lt;/textarea&gt;
  &lt;!-- Honeypot: hidden from people, bots fill it in --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;
  &lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
&lt;/form&gt;
</code></pre>
<h3>Keep the token out of the web root</h3>
<p>Save the token in a file one folder <strong>above</strong> <code>public_html</code>, so it can't be downloaded even if PHP stops running for some reason. Call it <code>telegram-config.php</code>:</p>
<pre><code class="language-php">&lt;?php
return [
    'token' =&gt; '123456789:AAH...',
    'chat_id' =&gt; '-1001234567890',
    'thanks_url' =&gt; '/thanks.html',
];
</code></pre>
<h3>The script</h3>
<p>Save this as <code>public_html/contact.php</code>:</p>
<pre><code class="language-php">&lt;?php
$config = require dirname(__DIR__) . '/telegram-config.php';

if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
    http_response_code(405);
    exit;
}

// Honeypot filled in: pretend it worked and send nothing.
if (!empty($_POST['_gotcha'])) {
    header('Location: ' . $config['thanks_url'], true, 303);
    exit;
}

function field(string $name, int $max): string {
    return mb_substr(trim((string) ($_POST[$name] ?? '')), 0, $max);
}

// The message uses Telegram's HTML mode, so &lt;, &gt; and &amp; in what visitors
// type have to be escaped, or Telegram refuses the whole message.
function h(string $text): string {
    return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
}

$name = field('name', 200);
$email = field('email', 200);
$message = field('message', 3500);

if ($email === '' || $message === '') {
    http_response_code(400);
    exit('Email and message are required');
}

$text = "&lt;b&gt;New contact form message&lt;/b&gt;\n\n"
    . '&lt;b&gt;Name:&lt;/b&gt; ' . h($name) . "\n"
    . '&lt;b&gt;Email:&lt;/b&gt; ' . h($email) . "\n\n"
    . h($message);

$ch = curl_init('https://api.telegram.org/bot' . $config['token'] . '/sendMessage');
curl_setopt_array($ch, [
    CURLOPT_POST =&gt; true,
    CURLOPT_POSTFIELDS =&gt; http_build_query([
        'chat_id' =&gt; $config['chat_id'],
        'text' =&gt; $text,
        'parse_mode' =&gt; 'HTML',
        'link_preview_options' =&gt; json_encode(['is_disabled' =&gt; true]),
    ]),
    CURLOPT_RETURNTRANSFER =&gt; true,
    CURLOPT_TIMEOUT =&gt; 10,
]);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($status !== 200) {
    // Telegram's error says what's wrong, like "chat not found".
    error_log('Telegram sendMessage failed: ' . $status . ' ' . $response);
    http_response_code(502);
    exit("Couldn't send your message. Please try again.");
}

header('Location: ' . $config['thanks_url'], true, 303);
</code></pre>
<p>Submit the form once. If nothing arrives, the reason is in your host's PHP error log (in cPanel, <strong>Metrics → Errors</strong>, or an <code>error_log</code> file next to the script).</p>
<h3>Why messages go missing</h3>
<ul>
<li><strong><code>400 Bad Request: can't parse entities</code>.</strong> Someone typed <code>&lt;3</code> or <code>a &lt; b</code> and it wasn't escaped. In HTML mode Telegram rejects the whole message rather than showing it as text, which is why the script runs everything through <code>h()</code>.</li>
<li><strong><code>400 Bad Request: chat not found</code>.</strong> The chat ID is wrong (often the minus sign got lost), or the bot isn't in that chat.</li>
<li><strong><code>403 Forbidden: bot can't initiate conversation with a user</code>.</strong> You never pressed <strong>Start</strong> in the private chat. After that it works.</li>
<li><strong><code>403 Forbidden: bot was kicked</code></strong> or <strong><code>bot was blocked by the user</code>.</strong> Someone removed the bot. Add it back.</li>
<li><strong><code>400 Bad Request: group chat was upgraded to a supergroup chat</code>.</strong> When a group gets bigger or changes some settings, Telegram turns it into a supergroup with a new ID. The response includes <code>migrate_to_chat_id</code>; put that number in your config.</li>
<li><strong>4,096 characters per message.</strong> Telegram rejects anything longer. The script cuts each field so a long message still fits.</li>
<li><strong>Rate limits.</strong> Telegram asks bots to stay under about one message a second per chat and 20 a minute in a group. Past that you get <code>429 Too Many Requests</code> and the script doesn't retry.</li>
<li><strong>Your host blocks outgoing requests.</strong> Some free hosting plans don't let PHP call other servers, so <code>curl_exec</code> times out and <code>$status</code> is <code>0</code>. Ask your host or move to a paid plan.</li>
</ul>
<p>The honeypot stops simple bots. Anything that fills in the form like a person, or posts straight to <code>contact.php</code>, still lands in your chat, and with nothing stored, a failed send means the message is gone. <a href="https://formkove.com/blog/stop-contact-form-spam/?ref=hashnode">How to stop contact form spam</a> goes through the other layers.</p>
<h2>2. A form backend</h2>
<p>With <a href="https://formkove.com/?ref=hashnode">Formkove</a>, the form posts to a Formkove URL and there's no script to host:</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions" method="POST"&gt;
</code></pre>
<p>In the form's <strong>Integrations → Telegram</strong>, paste the bot token and chat ID from the first section and click <strong>Send test</strong>. The token is stored encrypted and never shown again. Each submission arrives as one message with the form name, every field, a download link for each uploaded file and, when AI is on, its sentiment and tags. Field values are escaped, and long submissions are trimmed to fit 4,096 characters, with the full one in your dashboard.</p>
<p>You can add one Telegram connection per chat, and a <strong>routing rule</strong> decides what goes where. For example, a sales group that only gets submissions tagged <code>sales-lead</code>, or your private chat for anything with negative sentiment. Rules can test the AI's tags and sentiment, the spam score, or any form field.</p>
<p>Spam is held back before it reaches Telegram and kept in your dashboard for 30 days in case one was a real message. Every submission is saved and emailed to you even if the bot gets kicked from the chat. Rate limits and Telegram outages are retried, and every failed delivery is listed in <strong>Delivery history</strong> with Telegram's error.</p>
<p>Telegram, tags and routing are on the Pro and Agency plans, and Free accounts get them on their <a href="https://formkove.com/docs/limits/?ref=hashnode#your-first-50-submissions-on-free">first 50 submissions</a> (<a href="https://formkove.com/pricing/?ref=hashnode">pricing</a>). Setup and troubleshooting are in the <a href="https://formkove.com/docs/telegram-integration/?ref=hashnode">Telegram docs</a>.</p>
<hr />
<p><em>Originally published on <a href="https://formkove.com/blog/contact-form-to-telegram/?ref=hashnode">formkove.com</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to send an HTML form to Microsoft Teams (with Workflows)]]></title><description><![CDATA[If you followed an older tutorial to post a website form to Teams, it probably used an Incoming Webhook connector with a webhook.office.com URL. Those are…]]></description><link>https://formkove.hashnode.dev/how-to-send-an-html-form-to-microsoft-teams-with-workflows</link><guid isPermaLink="true">https://formkove.hashnode.dev/how-to-send-an-html-form-to-microsoft-teams-with-workflows</guid><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Tue, 01 Dec 2026 23:48:27 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc60673c0ad99dcb94d8cd/7838161e-c36a-497f-9a26-eac4295d1d4c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you followed an older tutorial to post a website form to Teams, it probably used an <strong>Incoming Webhook</strong> connector with a <code>webhook.office.com</code> URL. Those are gone. Microsoft retired Office 365 connectors in Teams, incoming webhooks included, and the rollout finished on May 22, 2026. Connector URLs don't post anything anymore.</p>
<p>There are three ways to do it now, depending on how much of the form you want to control:</p>
<ol>
<li><strong>Microsoft Forms and Power Automate</strong>, if your company is on Microsoft 365 and the form doesn't have to look like your site. No code.</li>
<li><strong>Your own HTML form, a small function and a Workflows webhook</strong>, if the form lives on your site.</li>
<li><strong>A form backend</strong>, if you also want spam filtering, storage and retries without running anything.</li>
</ol>
<h2>1. Microsoft Forms and Power Automate</h2>
<p>Build the form in <a href="https://forms.office.com">Microsoft Forms</a>, set it so <strong>anyone can respond</strong>, and put it on your site with <strong>Collect responses → Embed</strong>. Then in Power Automate, create an automated flow:</p>
<ol>
<li>Trigger: <strong>When a new response is submitted</strong> (Microsoft Forms), pick your form.</li>
<li>Action: <strong>Get response details</strong>, same form, with the response ID from the trigger.</li>
<li>Action: <strong>Post message in a chat or channel</strong> (Microsoft Teams). Post as the Flow bot to your channel and put the answers in the message.</li>
</ol>
<p>Every response shows up in the channel, and the answers stay in Forms too.</p>
<p>The tradeoff is the form itself. It's a Microsoft form in an iframe, with Microsoft's styling and a Microsoft footer, and you can't add a honeypot or your own validation. For an internal request form that's fine. For the contact form on your marketing site, most people want their own HTML.</p>
<h2>2. Your own form, a function and a Workflows webhook</h2>
<h3>Create the webhook</h3>
<ol>
<li>In Teams, open the channel, click <strong>⋯</strong> (More options) next to its name and choose <strong>Workflows</strong>.</li>
<li>Pick the template <strong>Send webhook alerts to a channel</strong>.</li>
<li>Name it, check the team and channel, and click <strong>Save</strong>.</li>
<li>Copy the webhook URL. It's long, so copy all of it.</li>
</ol>
<p>Anyone with that URL can post to your channel. It can't go in your page's JavaScript, so the form posts to a small function on your host that holds the URL and calls Teams.</p>
<h3>The form</h3>
<pre><code class="language-html">&lt;form action="/api/teams" method="POST"&gt;
  &lt;input name="name" placeholder="Name" required&gt;
  &lt;input name="email" type="email" placeholder="Email" required&gt;
  &lt;textarea name="message" placeholder="Message" required&gt;&lt;/textarea&gt;
  &lt;!-- Honeypot: hidden from people, bots fill it in --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;
  &lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
&lt;/form&gt;
</code></pre>
<h3>The function</h3>
<p>On Vercel, save this as <code>api/teams.js</code> and set <code>TEAMS_WEBHOOK_URL</code> and <code>THANKS_URL</code> (the full URL of your thank-you page) in the project's environment variables:</p>
<pre><code class="language-js">// Teams card text is markdown. Breaking "](" stops a visitor from
// disguising a link, like [https://yourbank.com](https://evil.example).
const clean = (value, max) =&gt; String(value ?? "").slice(0, max).replace(/\]\(/g, "]​(");

export async function POST(request) {
  const form = await request.formData();
  if (form.get("_gotcha")) return Response.redirect(process.env.THANKS_URL, 303);

  const name = clean(form.get("name"), 200);
  const email = clean(form.get("email"), 200);
  const message = clean(form.get("message"), 5000);
  if (!email || !message) return new Response("Email and message are required", { status: 400 });

  // The "Send webhook alerts to a channel" template posts the cards in
  // `attachments`, so send a card even for a simple message.
  const res = await fetch(process.env.TEAMS_WEBHOOK_URL, {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({
      type: "message",
      attachments: [
        {
          contentType: "application/vnd.microsoft.card.adaptive",
          contentUrl: null,
          content: {
            $schema: "http://adaptivecards.io/schemas/adaptive-card.json",
            type: "AdaptiveCard",
            version: "1.2",
            msteams: { width: "Full" },
            body: [
              { type: "TextBlock", text: "New contact form message", weight: "Bolder", size: "Medium" },
              {
                type: "FactSet",
                facts: [
                  { title: "Name", value: name },
                  { title: "Email", value: email },
                ],
              },
              { type: "TextBlock", text: message, wrap: true },
            ],
          },
        },
      ],
    }),
  });
  if (!res.ok) return new Response("Couldn't send your message. Please try again.", { status: 502 });

  return Response.redirect(process.env.THANKS_URL, 303);
}
</code></pre>
<p>On Netlify it's the same code in <code>netlify/functions/teams.mjs</code>, with <code>export default async (request) =&gt; { … }</code> instead of <code>export async function POST(request)</code>, plus <code>export const config = { path: "/api/teams" };</code> so the form's action still works. It's plain <code>fetch</code>, so any host that runs JavaScript functions will take it with small changes.</p>
<h3>What trips people up with Workflows</h3>
<ul>
<li><strong>A success response doesn't mean the card was posted.</strong> Teams accepts the request and the workflow runs after that, so it can fail inside Teams while your function sees a 2xx. When nothing shows up, open <strong>Workflows</strong> in Teams, pick the workflow and check its run history. That's also where you'll find it was turned off.</li>
<li><strong>The workflow belongs to a person, not the channel.</strong> If the account that created it is removed, say when someone leaves the company, the posts stop. Add a co-owner or create it from an account that will stay. This applies to the Power Automate flow in option 1 too.</li>
<li><strong>28 KB per message.</strong> Teams rejects anything bigger, which is why the code caps every value.</li>
<li><strong>Power Automate throttling.</strong> Workflows webhook triggers are throttled based on your Power Automate performance profile, and this function doesn't retry, so a burst can lose messages.</li>
<li><strong>Markdown in visitor text.</strong> Card text renders markdown, so a visitor can write a link that shows one address and opens another. The <code>clean()</code> helper breaks that pattern. Mentions are safe: in cards they need explicit entities, so a typed <code>@name</code> doesn't ping anyone.</li>
</ul>
<p>Posts also show as coming from the Workflows bot. You can't set your own name or icon.</p>
<p>The function also doesn't stop spam beyond the honeypot. Bots that post straight to <code>/api/teams</code> and hand-written SEO pitches still reach the channel (<a href="https://formkove.com/blog/stop-contact-form-spam/">how to stop contact form spam</a> covers the layers). And if the workflow fails, that submission is gone, because nothing stored it.</p>
<h2>3. A form backend</h2>
<p>With <a href="https://formkove.com/">Formkove</a>, the form posts to a Formkove URL and you don't deploy a function:</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions" method="POST"&gt;
</code></pre>
<p>Create the Workflows webhook as in option 2, then in the form's <strong>Integrations → Microsoft Teams</strong>, paste its URL and click <strong>Send test</strong>. If you paste an old <code>webhook.office.com</code> URL, Formkove tells you to create a workflow instead. Each submission arrives as a card with the form name, the fields, a download link for each uploaded file and, when AI is on, its sentiment and tags. Big submissions are trimmed to fit the 28 KB limit, with a note to see the rest in the dashboard.</p>
<p>To send only some submissions to a channel, add a <strong>routing rule</strong> to the connection. For example, a sales channel that only gets submissions tagged <code>sales-lead</code>, or a support channel for submissions where the <code>topic</code> field is <code>support</code>. Rules can test the tags and sentiment Formkove adds, the spam score, or any form field, and you can add one Teams connection per channel.</p>
<p>Spam is held back before it reaches Teams and kept in your dashboard for 30 days in case one was a real message. Every submission is saved and emailed to you even when the workflow is off, and failed deliveries are retried and listed in <strong>Delivery history</strong>.</p>
<p>Teams, tags and routing are on the Pro and Agency plans, and Free accounts get them on their <a href="https://formkove.com/docs/limits/#your-first-50-submissions-on-free">first 50 submissions</a> (<a href="https://formkove.com/pricing/">pricing</a>). Setup details and troubleshooting are in the <a href="https://formkove.com/docs/microsoft-teams-integration/">Microsoft Teams docs</a>.</p>
<hr />
<p><em>Originally published on <a href="https://formkove.com/blog/html-form-to-microsoft-teams/">formkove.com</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to send an HTML form to HubSpot (with a Service Key)]]></title><description><![CDATA[Create or update HubSpot contacts from an HTML form with a Service Key, a Cloudflare Worker, and property mapping.]]></description><link>https://formkove.hashnode.dev/how-to-send-an-html-form-to-hubspot-with-a-service-key</link><guid isPermaLink="true">https://formkove.hashnode.dev/how-to-send-an-html-form-to-hubspot-with-a-service-key</guid><category><![CDATA[Web Development]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Tue, 01 Dec 2026 02:20:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc60673c0ad99dcb94d8cd/a023800f-f29d-4dd5-97d2-6ce38208052d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Most tutorials for sending an HTML form to HubSpot tell you to open <strong>Integrations → Private Apps</strong> and generate an access token. HubSpot stopped allowing new legacy private apps in October 2026, so those steps hit a dead end on new setups.</p>
<p>Current HubSpot accounts use a <strong>Service Key</strong> instead, and the form still cannot call HubSpot's API from the browser. This guide builds it two ways: a small Cloudflare Worker that upserts contacts by email, and a form backend that maps your contact properties and keeps spam out of your CRM.</p>
<h2>Why the browser can't call HubSpot directly</h2>
<p>HubSpot's CRM API authenticates with a bearer token (a Service Key or an older private app token). Anything in your page's JavaScript is public, so putting that token in browser code lets anyone create or overwrite contacts in your CRM, and read records if the key has read scopes. HubSpot's API also does not return CORS headers for cross-origin browser requests.</p>
<p>So your form posts to a server you control, and only that server holds the key.</p>
<h2>Option A: a Cloudflare Worker</h2>
<h3>Create a HubSpot Service Key</h3>
<p>You need Super Admin or Developer Tools access in HubSpot:</p>
<ol>
<li>In HubSpot, open <strong>Development → Keys → Service keys</strong> (also under <strong>Settings → Integrations → Service Keys</strong>)</li>
<li>Click <strong>Create service key</strong> and name it (for example, <code>website-contact-form</code>)</li>
<li>Add the <code>crm.objects.contacts.write</code> scope</li>
<li>Copy the key right away (HubSpot hides it after creation)</li>
</ol>
<p>If you already created a legacy private app before October 2026 with <code>crm.objects.contacts.write</code>, its access token uses the same <code>Bearer</code> header and still works.</p>
<h3>Create a contact or update it by email</h3>
<p>The Worker first tries <code>POST /crm/v3/objects/contacts</code>. If HubSpot returns <code>409 Conflict</code> because the email already exists, it updates that contact with <code>PATCH /crm/v3/objects/contacts/{email}?idProperty=email</code>.</p>
<p>The update sends only the fields the visitor filled in, so blank fields leave existing values alone. HubSpot requires a custom unique property for partial updates through its batch upsert endpoint. <a href="https://developers.hubspot.com/docs/api-reference/legacy/crm/objects/contacts/guide#update-contacts">HubSpot contacts API</a></p>
<h3>The Worker</h3>
<pre><code class="language-js">// Form field name → HubSpot internal contact property name
const PROPERTIES = {
  firstname: "firstname",
  lastname: "lastname",
  company: "company",
  message: "message",
};
const ALLOWED_ORIGIN = "https://example.com";
const CONTACTS_URL = "https://api.hubapi.com/crm/v3/objects/contacts";

export default {
  async fetch(request, env) {
    const headers = { "Access-Control-Allow-Origin": ALLOWED_ORIGIN };
    if (request.method !== "POST") return new Response("Method not allowed", { status: 405 });

    const form = await request.formData();

    // Honeypot filled in: answer OK so the bot learns nothing.
    if (form.get("_gotcha")) return Response.json({ ok: true }, { headers });

    const email = String(form.get("email") ?? "").trim().toLowerCase();
    if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) {
      return Response.json({ ok: false }, { status: 400, headers });
    }

    const properties = {};
    for (const [field, prop] of Object.entries(PROPERTIES)) {
      const value = String(form.get(field) ?? "").trim().slice(0, 5000);
      if (value) properties[prop] = value;
    }

    const hubspotHeaders = {
      Authorization: `Bearer ${env.HUBSPOT_TOKEN}`,
      "Content-Type": "application/json",
    };
    let res = await fetch(CONTACTS_URL, {
      method: "POST",
      headers: hubspotHeaders,
      body: JSON.stringify({ properties: { email, ...properties } }),
    });
    if (res.status === 409) {
      if (Object.keys(properties).length === 0) return Response.json({ ok: true }, { headers });
      res = await fetch(`${CONTACTS_URL}/${encodeURIComponent(email)}?idProperty=email`, {
        method: "PATCH",
        headers: hubspotHeaders,
        body: JSON.stringify({ properties }),
      });
    }

    if (!res.ok) {
      console.error("HubSpot error", res.status, await res.text());
      return Response.json({ ok: false }, { status: 502, headers });
    }

    return Response.json({ ok: true }, { headers });
  },
};
</code></pre>
<p>Change <code>ALLOWED_ORIGIN</code> to your site, deploy the Worker, and store the Service Key as a secret so it never lives in your code:</p>
<pre><code class="language-bash">npx wrangler deploy
npx wrangler secret put HUBSPOT_TOKEN
</code></pre>
<h3>The form</h3>
<p>The Worker returns JSON, so submit with <code>fetch()</code> and replace the form with a confirmation message. Posting <code>FormData</code> avoids a CORS preflight request.</p>
<pre><code class="language-html">&lt;form id="contact"&gt;
  &lt;input name="firstname" placeholder="First name" required&gt;
  &lt;input name="lastname" placeholder="Last name"&gt;
  &lt;input name="email" type="email" placeholder="Email" required&gt;
  &lt;input name="company" placeholder="Company"&gt;
  &lt;textarea name="message" placeholder="Message" required&gt;&lt;/textarea&gt;
  &lt;!-- Honeypot: hidden from people, bots fill it in --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;
  &lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
  &lt;p id="status" role="status"&gt;&lt;/p&gt;
&lt;/form&gt;

&lt;script&gt;
  const form = document.getElementById("contact");
  const status = document.getElementById("status");
  form.addEventListener("submit", async (event) =&gt; {
    event.preventDefault();
    status.textContent = "";
    try {
      const res = await fetch("https://your-worker.your-subdomain.workers.dev", {
        method: "POST",
        body: new FormData(form),
      });
      if (res.ok) {
        form.replaceWith("Thanks, we got your message.");
        return;
      }
    } catch {}
    status.textContent = "Something went wrong. Please try again.";
  });
&lt;/script&gt;
</code></pre>
<p>Submit it once and the contact should appear in HubSpot under <strong>CRM → Contacts</strong>. Submit it a second time with the same email and the existing contact updates instead of failing.</p>
<h3>Where it breaks</h3>
<ul>
<li><strong>Internal names and option values.</strong> HubSpot properties use internal names (<code>firstname</code>, <code>jobtitle</code>), not labels ("First name"). Dropdown and multi-checkbox properties require internal option values (with multiple checkboxes joined by <code>;</code>), or HubSpot rejects the record.</li>
<li><strong>207 multi-status responses.</strong> If you switch to <code>batch/upsert</code>, a <code>207</code> response can contain failed records even when <code>res.ok</code> is true. <code>numErrors</code> is the count and <code>errors</code> has the details.</li>
<li><strong>Overwritten messages.</strong> Upserting updates the contact's properties, so a second submission from the same person overwrites <code>message</code> unless you store submissions separately too.</li>
<li><strong>Rate limits.</strong> HubSpot enforces per-10-second burst limits and returns <code>429</code> under traffic spikes. The Worker does not retry, so bursts drop leads.</li>
<li><strong>No second copy.</strong> If HubSpot is down or refuses a custom property, the Worker logs the status and the submission is gone.</li>
<li><strong>Spam contacts in your CRM.</strong> A honeypot stops simple bots, not written sales pitches. Every spam submission creates a real contact in HubSpot, skewing lead counts and firing any contact-created workflows.</li>
</ul>
<p>For a small personal site, the Worker is plenty. Past that, most of the work is keeping spam out of your CRM and retrying failed API calls.</p>
<h2>Option B: a form backend that maps the properties</h2>
<p>With <a href="https://formkove.com/?ref=hashnode">Formkove</a>, the form posts to a Formkove endpoint. Each submission is saved in your dashboard, checked for spam, emailed to you and upserted as a HubSpot contact matched by email.</p>
<p><strong>Point the form at Formkove.</strong> Create a form at <a href="https://app.formkove.com/signup?ref=hashnode">app.formkove.com</a> and use its endpoint as the <code>action</code>. No Worker and no JavaScript required, and the <code>_gotcha</code> honeypot is on by default.</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions" method="POST"&gt;
</code></pre>
<p><strong>Connect HubSpot.</strong> Create a HubSpot Service Key under <strong>Development → Keys → Service keys</strong> with <code>crm.objects.contacts.write</code> and <code>crm.schemas.contacts.read</code> (existing private app tokens with those scopes work too). In your form's <strong>Integrations</strong>, click <strong>Connect HubSpot</strong> and paste the key. It is stored encrypted and never shown again.</p>
<p><strong>Map the properties.</strong> Formkove reads your HubSpot contact properties and lists the writable ones, putting common fields like <code>email</code>, <code>firstname</code>, <code>lastname</code>, <code>phone</code>, <code>company</code> and <code>message</code> first. <strong>Email</strong> is required (saved in lowercase); for every other property you pick a form field, a Formkove value (Submitted at, Submission ID, Form name, Sentiment, Tags, Spam score, File links) or a fixed text. Comma-separated values for multi-checkbox properties are formatted for HubSpot automatically, and <strong>Send test</strong> verifies the key can reach your contacts without adding a fake record.</p>
<p><strong>Send only qualified leads to HubSpot.</strong> Define tags in plain words on the form's <strong>AI &amp; Spam</strong> page (for example, <code>sales-lead</code>: asks for pricing, a quote or a demo), then add a routing rule to the HubSpot connection:</p>
<ul>
<li><strong>Tag</strong> has any of <code>sales-lead</code></li>
</ul>
<p>Now support questions and vendor pitches still reach your email and dashboard without creating HubSpot contacts. Rules can also check any form field, such as <code>budget</code> is greater than <code>5000</code>. Email is not routed, so you still get every real submission in your inbox.</p>
<p>What comes with it:</p>
<ul>
<li><strong>Spam held back</strong> before it reaches HubSpot, so bots and cold pitches do not become CRM contacts. Held spam stays in your dashboard for 30 days in case a real message needs releasing.</li>
<li><strong>Every submission saved</strong> in Formkove's dashboard, including full messages when someone submits again with the same email. Failed HubSpot deliveries are retried automatically and shown in <strong>Delivery history</strong> with the reason.</li>
<li><strong>Rate limits</strong> on every form: 10 a minute and 30 an hour per IP address.</li>
</ul>
<p>HubSpot, tags and routing are on the Pro and Agency plans, and Free accounts get them on their <a href="https://formkove.com/docs/limits/?ref=hashnode#your-first-50-submissions-on-free">first 50 submissions</a> (<a href="https://formkove.com/pricing/?ref=hashnode">pricing</a>). Setup details and troubleshooting are in the <a href="https://formkove.com/docs/hubspot-integration/?ref=hashnode">HubSpot docs</a>.</p>
<hr />
<p><em>Originally published on <a href="https://formkove.com/blog/html-form-to-hubspot/?ref=hashnode">formkove.com</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to send an HTML form to Discord]]></title><description><![CDATA[Post contact form submissions to a Discord channel: a small Worker that keeps the webhook secret, no @everyone pings, and routing by content.]]></description><link>https://formkove.hashnode.dev/html-form-to-discord</link><guid isPermaLink="true">https://formkove.hashnode.dev/html-form-to-discord</guid><category><![CDATA[webdev]]></category><category><![CDATA[discord]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Thu, 26 Nov 2026 01:15:38 GMT</pubDate><content:encoded><![CDATA[<p>Discord channels have <strong>webhooks</strong>: a secret URL that posts a message to one channel when you send it JSON. That makes Discord an easy place to collect form submissions for a small team, a community or a side project. The form just can't call the webhook itself.</p>
<p>This guide covers the webhook, a small Cloudflare Worker that sits between your form and Discord, the Discord-specific traps, and a form backend that does it for you.</p>
<h2>1. Create a Discord webhook</h2>
<ol>
<li>Open your server's <strong>Server Settings → Integrations → Webhooks</strong>.</li>
<li>Create a webhook, name it ("Website forms") and pick the channel.</li>
<li>Click <strong>Copy Webhook URL</strong>. It looks like <code>https://discord.com/api/webhooks/123…/abc…</code>.</li>
</ol>
<p>Anyone with that URL can post to your channel, so it never goes in your page source.</p>
<h2>2. Option A: a Cloudflare Worker</h2>
<p>The form posts to your Worker:</p>
<pre><code class="language-html">&lt;form action="https://contact-to-discord.YOUR-SUBDOMAIN.workers.dev" method="POST"&gt;
  &lt;input name="name" placeholder="Name" required&gt;
  &lt;input name="email" type="email" placeholder="Email" required&gt;
  &lt;textarea name="message" placeholder="Message" required&gt;&lt;/textarea&gt;
  &lt;!-- Honeypot: hidden from people, bots fill it in --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;
  &lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
&lt;/form&gt;
</code></pre>
<p>The Worker turns the fields into a Discord message:</p>
<pre><code class="language-js">export default {
  async fetch(request, env) {
    if (request.method !== "POST") return new Response("Method not allowed", { status: 405 });

    const form = await request.formData();
    if (form.get("_gotcha")) return Response.redirect(env.THANKS_URL, 303);

    const name = String(form.get("name") ?? "").slice(0, 200);
    const email = String(form.get("email") ?? "").slice(0, 200);
    const message = String(form.get("message") ?? "").slice(0, 1500);
    if (!email || !message) return new Response("Email and message are required", { status: 400 });

    const webhookUrl = new URL(env.DISCORD_WEBHOOK_URL);
    // wait=true makes Discord confirm the message was saved before answering.
    webhookUrl.searchParams.set("wait", "true");

    const res = await fetch(webhookUrl, {
      method: "POST",
      headers: { "content-type": "application/json" },
      body: JSON.stringify({
        content: `**New message from ${name}** (${email})\n${message}`,
        // Turn off mention parsing so visitor text can't ping users.
        allowed_mentions: { parse: [] },
      }),
    });
    if (!res.ok) return new Response("Couldn't send your message. Please try again.", { status: 502 });

    return Response.redirect(env.THANKS_URL, 303);
  },
};
</code></pre>
<p>Store the URL as a secret and deploy:</p>
<pre><code class="language-bash">npx wrangler secret put DISCORD_WEBHOOK_URL
npx wrangler deploy
</code></pre>
<p>with <code>THANKS_URL</code> set as a variable in <code>wrangler.jsonc</code>.</p>
<h3>The Discord traps</h3>
<ul>
<li><strong>Mentions.</strong> Discord webhooks parse user mentions (<code>&lt;@user_id&gt;</code>) by default (unlike regular messages, <code>@everyone</code> and role mentions are off by default). Passing <code>allowed_mentions: { parse: [] }</code> turns off all mention parsing so visitor text can't ping anyone.</li>
<li><strong>Unconfirmed writes.</strong> Without <code>?wait=true</code>, Discord answers <code>204</code> before confirming the message was saved, so a failed save won't return an error. Adding <code>wait=true</code> makes the Worker wait for confirmation.</li>
<li><strong>Length.</strong> A message's <code>content</code> is capped at 2,000 characters, and Discord rejects longer ones with a 400. Trim the message (the code keeps 1,500 for the text, leaving room for the name and email), or the long submissions are the ones you lose.</li>
</ul>
<h3>What this version doesn't do</h3>
<ul>
<li><strong>Spam.</strong> Bots that post straight to the Worker, and hand-written SEO pitches, still reach the channel. See <a href="https://formkove.com/blog/stop-contact-form-spam/?ref=hashnode">how to stop contact form spam</a> for the layers.</li>
<li><strong>Storage.</strong> If the webhook is deleted or Discord is down, the submission is gone.</li>
<li><strong>Rate limits.</strong> One script can flood the channel.</li>
<li><strong>Sorting.</strong> Every message lands in the same channel.</li>
</ul>
<h2>3. Option B: a form backend</h2>
<p>With <a href="https://formkove.com/?ref=hashnode">Formkove</a>, the form posts to a Formkove URL instead of your own Worker:</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions" method="POST"&gt;
</code></pre>
<p>Then, in the form's <strong>Integrations → Discord</strong>, paste the webhook URL from step 1 and click <strong>Send test</strong>. Each submission arrives as a message with the form name, the fields and, when AI is on, its sentiment and tags.</p>
<p>To send only some submissions to a channel, add a <strong>routing rule</strong> to the connection. For example, a <code>#leads</code> channel that only gets submissions tagged <code>sales-lead</code>, or a <code>#bugs</code> channel for submissions where the <code>topic</code> field is <code>bug</code>. Rules can test the tags and sentiment Formkove adds, the spam score, or any form field, and you can add one Discord connection per channel.</p>
<p>What comes with it:</p>
<ul>
<li><strong>Spam held back</strong> before anything reaches Discord, kept in your dashboard for 30 days in case one was a real message.</li>
<li><strong>Every submission saved and emailed to you</strong>, even when Discord is down. Failed deliveries are retried and listed in <strong>Delivery history</strong>.</li>
<li><strong>Rate limits</strong> on every form, and mentions in submissions never ping your server.</li>
</ul>
<p>Discord, tags and routing are on the Pro and Agency plans, and Free accounts get them on their <a href="https://formkove.com/docs/limits/?ref=hashnode#your-first-50-submissions-on-free">first 50 submissions</a> (<a href="https://formkove.com/pricing/?ref=hashnode">pricing</a>). Setup details are in the <a href="https://formkove.com/docs/discord-integration/?ref=hashnode">Discord docs</a>.</p>
<hr />
<p><em>Originally published on</em> <a href="https://formkove.com/blog/html-form-to-discord/?ref=hashnode"><em>formkove.com</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[Static site contact form: Netlify, Vercel, Cloudflare Pages]]></title><description><![CDATA[Add a working contact form to a static site on Netlify, Vercel or Cloudflare Pages, with no serverless function, a thank-you page and spam protection.]]></description><link>https://formkove.hashnode.dev/contact-form-static-site</link><guid isPermaLink="true">https://formkove.hashnode.dev/contact-form-static-site</guid><category><![CDATA[webdev]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Tue, 24 Nov 2026 16:11:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc60673c0ad99dcb94d8cd/ab2f8004-7511-430d-840d-85e0fbee92e8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A static site has no server of its own to receive a form. On Netlify, Vercel and Cloudflare Pages you have three ways to handle one:</p>
<table>
<thead>
<tr>
<th>Option</th>
<th>Trade-off</th>
</tr>
</thead>
<tbody><tr>
<td>Your host's form feature</td>
<td>Netlify has one (Netlify Forms). Vercel and Cloudflare Pages don't.</td>
</tr>
<tr>
<td>A serverless function</td>
<td>Netlify Functions, Vercel Functions or Pages Functions. Full control, but you build email delivery, spam filtering and storage yourself.</td>
</tr>
<tr>
<td>A form backend</td>
<td>Keep your own HTML. The backend receives the POST, filters spam and emails you. It works the same on any host.</td>
</tr>
</tbody></table>
<p>This guide uses a form backend, Formkove, which has a free plan with 300 submissions a month. The HTML is the same on all three hosts; the differences are in step 2. On GitHub Pages or Jekyll? Follow <a href="https://formkove.com/blog/github-pages-contact-form/?ref=hashnode">How to add a contact form to GitHub Pages</a> instead.</p>
<h2>1. Create a form</h2>
<p><a href="https://app.formkove.com/signup?ref=hashnode">Sign up free</a>, click <strong>New form</strong>, and copy the endpoint URL:</p>
<pre><code class="language-text">https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions
</code></pre>
<p>Submissions go to your account email by default. To add another address, use <strong>Settings → Submission notifications</strong> and confirm it from the verification email.</p>
<h2>2. Allow your site's address</h2>
<p>In the form's <strong>Settings → Allowed Origins &amp; Redirects</strong>, add the address your site runs on. You need this to redirect to your own thank-you page or to submit with JavaScript.</p>
<ul>
<li><strong>Netlify:</strong> <code>https://SITE.netlify.app</code>, plus your custom domain.</li>
<li><strong>Vercel:</strong> <code>https://PROJECT.vercel.app</code>, plus your custom domain.</li>
<li><strong>Cloudflare Pages:</strong> enter the bare domain <code>PROJECT.pages.dev</code>. A bare domain also matches its subdomains, so preview deployments like <code>abc123.PROJECT.pages.dev</code> work too.</li>
</ul>
<p>Netlify and Vercel preview URLs use their own hostnames. If you test on a preview, add that address as well.</p>
<h2>3. Add the HTML</h2>
<p>Paste this into your contact page and replace <code>YOUR_FORM_ID</code> and the redirect address:</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions?redirect=https://example.com/thanks/" method="POST"&gt;
  &lt;label for="name"&gt;Name&lt;/label&gt;
  &lt;input id="name" name="name" type="text" autocomplete="name" required&gt;

  &lt;label for="email"&gt;Email&lt;/label&gt;
  &lt;input id="email" name="email" type="email" autocomplete="email" required&gt;

  &lt;label for="message"&gt;Message&lt;/label&gt;
  &lt;textarea id="message" name="message" rows="5" required&gt;&lt;/textarea&gt;

  &lt;!-- Honeypot: hidden from people, filled in by bots. Leave it empty. --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;label&gt;Leave this empty &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;&lt;/label&gt;
  &lt;/div&gt;

  &lt;button type="submit"&gt;Send&lt;/button&gt;
&lt;/form&gt;
</code></pre>
<p>Then create the <code>/thanks/</code> page. The redirect must be a full URL on an address you allowed in step 2. Without <code>?redirect=</code>, visitors see Formkove's success page.</p>
<p>Each field's <code>name</code> becomes a column in your dashboard. The <code>email</code> field becomes the reply-to address on the notification, so you can answer by replying to the email.</p>
<p><strong>On Netlify:</strong> don't add <code>netlify</code> or <code>data-netlify="true"</code> to this form. Those attributes hand the form to Netlify Forms instead.</p>
<p><strong>With a framework:</strong> the same form works in any framework that outputs HTML. There are guides for <a href="https://formkove.com/docs/nextjs-forms/?ref=hashnode">Next.js</a>, <a href="https://formkove.com/docs/astro-forms/?ref=hashnode">Astro</a>, <a href="https://formkove.com/docs/react-forms/?ref=hashnode">React</a>, <a href="https://formkove.com/docs/vue-forms/?ref=hashnode">Vue</a>, <a href="https://formkove.com/docs/svelte-forms/?ref=hashnode">Svelte</a> and <a href="https://formkove.com/docs/static-site-generators/?ref=hashnode">Hugo, Jekyll and Eleventy</a>. The form ID is safe to put in public HTML: it can only send submissions to its own form.</p>
<h2>4. Or show a message without leaving the page</h2>
<p>To keep visitors on the page, remove <code>?redirect=…</code> from the action and add:</p>
<pre><code class="language-html">&lt;script&gt;
  const form = document.querySelector("form");
  const status = document.createElement("p");
  status.setAttribute("role", "status");
  form.append(status);
  form.addEventListener("submit", async (event) =&gt; {
    event.preventDefault();
    status.textContent = "";
    try {
      const res = await fetch(form.action, {
        method: "POST",
        headers: { Accept: "application/json" },
        body: new FormData(form),
      });
      if (res.ok) {
        form.replaceWith("Thanks! We'll be in touch.");
        return;
      }
    } catch {}
    status.textContent = "Something went wrong. Please try again.";
  });
&lt;/script&gt;
</code></pre>
<p>This needs your site's address under Allowed Origins (step 2), or the browser blocks the response.</p>
<h2>5. Keep spam out</h2>
<p>Every Formkove form is rate limited and checked by an AI spam filter, which holds spam in your dashboard instead of emailing it to you. New forms also have the <code>_gotcha</code> honeypot turned on, which the hidden input in step 3 uses. If bots still get through, add <a href="https://formkove.com/docs/spam-protection/?ref=hashnode">Cloudflare Turnstile</a> with your own keys.</p>
<p>Submissions the AI flags as spam count toward your monthly limit; ones stopped by the honeypot or Turnstile don't. <a href="https://formkove.com/blog/stop-contact-form-spam/?ref=hashnode">How to stop contact form spam</a> explains what each layer catches.</p>
<h2>Troubleshooting</h2>
<ul>
<li><strong>You land on Formkove's page instead of yours:</strong> the redirect address isn't allowed, or isn't a full <code>https://</code> URL.</li>
<li><strong>A CORS error in the console with</strong> <code>fetch()</code><strong>:</strong> the address you're testing on isn't under Allowed Origins. Previews count as separate addresses.</li>
<li><strong>On Netlify, submissions show up in Netlify instead:</strong> remove the <code>netlify</code> attribute from the form and redeploy.</li>
<li><strong>No email arrives:</strong> check your spam folder for the first one, and confirm the recipient address if you added a new one. Submissions always appear in your dashboard.</li>
</ul>
<p>More fixes are in <a href="https://formkove.com/docs/troubleshooting/?ref=hashnode">troubleshooting</a>.</p>
<hr />
<p><em>Originally published on</em> <a href="https://formkove.com/blog/contact-form-static-site/?ref=hashnode"><em>formkove.com</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to send an HTML form to Slack]]></title><description><![CDATA[Post contact form submissions to Slack: the incoming webhook, a small Worker that keeps it secret, Slack's escaping, and sales leads to #sales.]]></description><link>https://formkove.hashnode.dev/html-form-to-slack</link><guid isPermaLink="true">https://formkove.hashnode.dev/html-form-to-slack</guid><category><![CDATA[webdev]]></category><category><![CDATA[HTML]]></category><category><![CDATA[slack]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Mon, 23 Nov 2026 01:32:48 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc60673c0ad99dcb94d8cd/9fee8389-cb35-48d1-b237-910244c6040c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Slack can't receive a form post on its own. It gives you an <strong>incoming webhook</strong>: a secret URL that posts a message to one channel when you send it JSON. Your form needs something in between that turns the form fields into that JSON and keeps the URL out of your page.</p>
<p>This guide builds that in-between step two ways: a small Cloudflare Worker you run yourself, then a form backend that does it for you and sends each submission to the right channel.</p>
<h2>1. Create a Slack incoming webhook</h2>
<ol>
<li>Go to <a href="https://api.slack.com/apps">api.slack.com/apps</a>, click <strong>Create New App</strong>, then <strong>From scratch</strong>.</li>
<li>Name it (for example "Website forms") and pick your workspace.</li>
<li>Open <strong>Incoming Webhooks</strong>, switch it on, and click <strong>Add New Webhook</strong>.</li>
<li>Pick the channel and copy the URL. It looks like <code>https://hooks.slack.com/services/T000/B000/XXXX</code>.</li>
</ol>
<p>Treat that URL as a password. Anyone who has it can post to your channel.</p>
<h2>Why the form can't post to Slack directly</h2>
<p>It's tempting to <code>fetch()</code> the webhook from the browser. Two problems:</p>
<ul>
<li><strong>The URL ends up in your page source.</strong> Anyone can copy it and post whatever they like to your channel, as often as they like.</li>
<li><strong>Slack expects a message</strong>, a JSON body with a <code>text</code> field, not your form's <code>name</code>, <code>email</code> and <code>message</code> fields. A plain <code>&lt;form action&gt;</code> pointed at the webhook doesn't produce one.</li>
</ul>
<p>So the form posts to your own endpoint, and that endpoint calls Slack.</p>
<h2>2. Option A: a Cloudflare Worker</h2>
<p>A Worker is free for this volume and needs no server. The form:</p>
<pre><code class="language-html">&lt;form action="https://contact-to-slack.YOUR-SUBDOMAIN.workers.dev" method="POST"&gt;
  &lt;input name="name" placeholder="Name" required&gt;
  &lt;input name="email" type="email" placeholder="Email" required&gt;
  &lt;textarea name="message" placeholder="Message" required&gt;&lt;/textarea&gt;
  &lt;!-- Honeypot: hidden from people, bots fill it in --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;
  &lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
&lt;/form&gt;
</code></pre>
<p>The Worker:</p>
<pre><code class="language-js">// Slack reads &lt;, &gt; and &amp; as markup: &lt;!channel&gt; would ping everyone.
const esc = (s) =&gt; String(s ?? "").replace(/&amp;/g, "&amp;amp;").replace(/&lt;/g, "&amp;lt;").replace(/&gt;/g, "&amp;gt;");

export default {
  async fetch(request, env) {
    if (request.method !== "POST") return new Response("Method not allowed", { status: 405 });

    const form = await request.formData();
    // Honeypot filled in: pretend it worked so the bot learns nothing.
    if (form.get("_gotcha")) return Response.redirect(env.THANKS_URL, 303);

    const name = esc(form.get("name")).slice(0, 200);
    const email = esc(form.get("email")).slice(0, 200);
    const message = esc(form.get("message")).slice(0, 3000);
    if (!email || !message) return new Response("Email and message are required", { status: 400 });

    const res = await fetch(env.SLACK_WEBHOOK_URL, {
      method: "POST",
      headers: { "content-type": "application/json" },
      body: JSON.stringify({ text: `*New message from ${name}* (${email})\n&gt;${message.replace(/\n/g, "\n&gt;")}` }),
    });
    if (!res.ok) return new Response("Couldn't send your message. Please try again.", { status: 502 });

    return Response.redirect(env.THANKS_URL, 303);
  },
};
</code></pre>
<p>Keep the webhook URL out of the code:</p>
<pre><code class="language-bash">npx wrangler secret put SLACK_WEBHOOK_URL
</code></pre>
<p>and set <code>THANKS_URL</code> (your thank-you page) as a variable in <code>wrangler.jsonc</code>, then <code>npx wrangler deploy</code>.</p>
<p>Two details in that code are easy to miss:</p>
<ul>
<li><strong>Escaping.</strong> Slack treats <code>&lt;</code>, <code>&gt;</code> and <code>&amp;</code> as control characters. Without escaping, a visitor who types <code>&lt;!channel&gt;</code> pings your whole channel.</li>
<li><strong>A 303 redirect</strong> sends the browser to your thank-you page with a GET, so refreshing it doesn't post the form twice.</li>
</ul>
<h3>What this version doesn't do</h3>
<p>It works, and for a personal site it may be all you need. What it leaves out:</p>
<ul>
<li><strong>Spam.</strong> The honeypot stops simple bots. Scripts that post straight to the Worker, and people pasting SEO pitches, still land in Slack. Adding <a href="https://formkove.com/blog/stop-contact-form-spam/?ref=hashnode">Turnstile</a> helps with the first; the second needs something that reads the message.</li>
<li><strong>Storage.</strong> If Slack is down or the webhook was revoked, the submission is gone.</li>
<li><strong>Rate limits.</strong> Nothing stops one script from posting a thousand messages into your channel.</li>
<li><strong>Sorting.</strong> Every message goes to the same channel. Sending sales leads to <code>#sales</code> and support requests to <code>#support</code> means writing your own rules, and deciding which is which.</li>
</ul>
<h2>3. Option B: a form backend that routes by what the message says</h2>
<p>With <a href="https://formkove.com/?ref=hashnode">Formkove</a>, the form posts to a Formkove URL. Each submission is saved, checked for spam, emailed to you, and posted to Slack, and rules decide which channel gets which submission.</p>
<p><strong>Point the form at Formkove.</strong> Create a form at <a href="https://app.formkove.com/signup?ref=hashnode">app.formkove.com</a> and use its endpoint as the action. The <code>_gotcha</code> honeypot above is on by default.</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions" method="POST"&gt;
</code></pre>
<p><strong>Connect Slack.</strong> Create the incoming webhook from step 1, then in the form's <strong>Integrations → Slack</strong>, paste the URL and save. Click <strong>Send test</strong> to check it.</p>
<p><strong>Describe your tags.</strong> On the form's <strong>AI &amp; Spam</strong> page, add tags in plain words:</p>
<table>
<thead>
<tr>
<th>Tag</th>
<th>Description</th>
</tr>
</thead>
<tbody><tr>
<td><code>sales-lead</code></td>
<td>Wants a quote, a price or to hire us</td>
</tr>
<tr>
<td><code>support</code></td>
<td>An existing customer with a problem</td>
</tr>
</tbody></table>
<p>Formkove classifies each submission before delivery: spam is held back, and the tags that fit are added along with a sentiment.</p>
<p><strong>Route each channel.</strong> Add a Slack connection per channel, each with its own webhook URL and a routing rule:</p>
<ul>
<li><code>#sales</code>: <strong>Tag</strong> has any of <code>sales-lead</code></li>
<li><code>#support</code>: <strong>Tag</strong> has any of <code>support</code>, <strong>or</strong> <strong>Sentiment</strong> is any of <code>negative</code></li>
</ul>
<p>Rules can also test any form field (for example <code>budget</code> is greater than <code>5000</code>), and you can combine conditions with <strong>all</strong> or <strong>any</strong>. A connection without rules gets every submission that isn't spam. Email isn't routed: you get every real submission by email whatever the rules say.</p>
<p>What you get on top of the Worker version:</p>
<ul>
<li><strong>Spam held back before Slack sees it.</strong> It waits in your dashboard for 30 days, and <strong>Not spam, deliver</strong> sends a false positive on to its channel.</li>
<li><strong>Every submission saved</strong>, even when Slack is down. Failed deliveries are retried and show up in <strong>Delivery history</strong>.</li>
<li><strong>Rate limits</strong> on every form: 10 a minute and 30 an hour per IP address.</li>
</ul>
<p>Slack, routing and tags are on the Pro and Agency plans, and Free accounts get them on their <a href="https://formkove.com/docs/limits/?ref=hashnode#your-first-50-submissions-on-free">first 50 submissions</a> (<a href="https://formkove.com/pricing/?ref=hashnode">pricing</a>). The setup is in the <a href="https://formkove.com/docs/slack-integration/?ref=hashnode">Slack docs</a> and the <a href="https://formkove.com/docs/zapier-and-webhooks/?ref=hashnode#routing-rules">routing rules docs</a>.</p>
<hr />
<p><em>Originally published on <a href="https://formkove.com/blog/html-form-to-slack/?ref=hashnode">formkove.com</a>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to send an HTML form to Notion]]></title><description><![CDATA[Save contact form submissions as Notion database pages: a small Cloudflare Worker, its limits, and Formkove property mapping.]]></description><link>https://formkove.hashnode.dev/how-to-send-an-html-form-to-notion</link><guid isPermaLink="true">https://formkove.hashnode.dev/how-to-send-an-html-form-to-notion</guid><category><![CDATA[webdev]]></category><category><![CDATA[notion]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Sat, 21 Nov 2026 18:30:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc60673c0ad99dcb94d8cd/9d791c40-6e3b-4860-9a21-ffb08da848d0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A Notion database is a handy place for form submissions. Each one becomes a page you can open, add notes to, give a status and assign, and the whole team sees it in a board or table view.</p>
<p>Notion's own forms do this, but they live on a Notion page. If the form is already on your site, in plain HTML or React or Astro, something has to take the post and call Notion's API. This guide does it two ways: a small Cloudflare Worker you run yourself, and a form backend that maps the properties for you.</p>
<h2>Why the browser can't call Notion directly</h2>
<p>Notion's API uses an integration secret. Anything in your page's JavaScript is public, so a secret in the browser lets anyone add pages to your database, and read it too. Notion's API also doesn't answer browser requests from other sites (no CORS headers), so the call fails there anyway.</p>
<p>So the form posts to a small server of yours, and only that server holds the secret.</p>
<h2>Option A: a Cloudflare Worker</h2>
<h3>Set up the database</h3>
<p>Create a database with a <strong>Name</strong> property (the title, every database has one), an <strong>Email</strong> property of type Email and a <strong>Message</strong> property of type Text. Then create the integration:</p>
<ol>
<li>Open <a href="https://www.notion.so/profile/integrations">notion.so/profile/integrations</a> and create an internal integration</li>
<li>Under <strong>Capabilities</strong>, turn on <strong>Insert content</strong></li>
<li>Copy the <strong>Internal Integration Secret</strong></li>
<li>Open the database in Notion, click <strong>⋯</strong> → <strong>Connections</strong> and add the integration</li>
</ol>
<p>Don't skip step 4: an integration sees nothing until a page or database is shared with it. You also need the database ID: open the database as a full page and it's the 32 characters before the <code>?v=</code> in the URL.</p>
<h3>The Worker</h3>
<pre><code class="language-js">// Form field name → [Notion property name, property type]
const PROPERTIES = {
  name: ["Name", "title"],
  email: ["Email", "email"],
  message: ["Message", "rich_text"],
};
const ALLOWED_ORIGIN = "https://example.com";

export default {
  async fetch(request, env) {
    const headers = { "Access-Control-Allow-Origin": ALLOWED_ORIGIN };
    if (request.method !== "POST") return new Response("Method not allowed", { status: 405 });

    const form = await request.formData();

    // Honeypot filled in: answer OK so the bot learns nothing.
    if (form.get("_gotcha")) return Response.json({ ok: true }, { headers });

    const properties = {};
    for (const [field, [property, type]] of Object.entries(PROPERTIES)) {
      // A single Notion text item holds 2,000 characters.
      const value = String(form.get(field) ?? "").trim().slice(0, 2000);
      if (!value) continue;
      if (type === "email") properties[property] = { email: value };
      else properties[property] = { [type]: [{ type: "text", text: { content: value } }] };
    }
    if (!properties.Email) return Response.json({ ok: false }, { status: 400, headers });

    const res = await fetch("https://api.notion.com/v1/pages", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${env.NOTION_TOKEN}`,
        "Notion-Version": "2022-06-28",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        parent: { database_id: env.NOTION_DATABASE_ID },
        properties,
      }),
    });

    if (!res.ok) {
      console.error("Notion error", res.status, await res.text());
      return Response.json({ ok: false }, { status: 502, headers });
    }
    return Response.json({ ok: true }, { headers });
  },
};
</code></pre>
<p>Change <code>ALLOWED_ORIGIN</code> to your site. Then deploy it and store the secret, so it never sits in your code:</p>
<pre><code class="language-bash">npx wrangler deploy
npx wrangler secret put NOTION_TOKEN
</code></pre>
<p>Add <code>NOTION_DATABASE_ID</code> as a variable in <code>wrangler.jsonc</code> or the dashboard.</p>
<p>The title property has to be written as <code>title</code> and text as <code>rich_text</code>. Each property type has its own shape, which is why the Worker keeps the type next to the name.</p>
<p>The Worker pins Notion API version <code>2022-06-28</code>, which takes a database ID as the parent. Newer versions (<code>2025-09-03</code> and later) add pages to a <code>data_source_id</code> inside the database instead, so you'd look up the data source ID first. The older version is simpler and works for a database with one data source, which is what a new database has; if your database has multiple data sources, <code>2022-06-28</code> will fail and you need the <code>2025-09-03</code> flow.</p>
<h3>The form</h3>
<p>The Worker answers with JSON, so post with <code>fetch()</code> and show the thank-you message on your own page. A <code>FormData</code> body doesn't need a CORS preflight, which keeps the Worker short.</p>
<pre><code class="language-html">&lt;form id="contact"&gt;
  &lt;input name="name" placeholder="Name" required&gt;
  &lt;input name="email" type="email" placeholder="Email" required&gt;
  &lt;textarea name="message" placeholder="Message" required&gt;&lt;/textarea&gt;
  &lt;!-- Honeypot: hidden from people, bots fill it in --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;
  &lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
  &lt;p id="status" role="status"&gt;&lt;/p&gt;
&lt;/form&gt;

&lt;script&gt;
  const form = document.getElementById("contact");
  const status = document.getElementById("status");
  form.addEventListener("submit", async (event) =&gt; {
    event.preventDefault();
    status.textContent = "";
    try {
      const res = await fetch("https://your-worker.your-subdomain.workers.dev", {
        method: "POST",
        body: new FormData(form),
      });
      if (res.ok) {
        form.replaceWith("Thanks, we got your message.");
        return;
      }
    } catch {}
    status.textContent = "Something went wrong. Please try again.";
  });
&lt;/script&gt;
</code></pre>
<p>Submit it once and a page should show up in the database.</p>
<h3>Where it breaks</h3>
<ul>
<li><strong>Property names and types have to match.</strong> Rename <strong>Email</strong> in Notion, or change it to a Text property, and every submission fails with a <code>validation_error</code> until you change the Worker.</li>
<li><strong>Not shared.</strong> If the integration isn't added under the database's <strong>Connections</strong>, or <strong>Insert content</strong> is off, Notion answers <code>404</code> or <code>403</code> and nothing saves.</li>
<li><strong>Long messages.</strong> One text item holds 2,000 characters. The Worker cuts there. To keep more, you split the text into several items yourself.</li>
<li><strong>Select and status.</strong> A select value that isn't an option yet is added as a new one. A status value has to exist already, or the whole page is refused.</li>
<li><strong>Rate limits.</strong> Notion allows about 3 requests a second on average and answers <code>429</code> above that. The Worker doesn't retry, so a burst loses submissions.</li>
<li><strong>No second copy.</strong> When Notion is down or refuses a page, the Worker logs an error and the submission is gone. Fixing that means a queue and retries.</li>
<li><strong>Spam.</strong> The honeypot only stops simple bots. Written sales pitches get through and become pages in your database.</li>
</ul>
<p>For a personal site with a few messages a week, the Worker is fine. Past that, most of the work is in the list above.</p>
<h2>Option B: a form backend that maps the properties</h2>
<p>With <a href="https://formkove.com/?ref=hashnode">Formkove</a>, the form posts to a Formkove URL. Each submission is saved, checked for spam, emailed to you and added to Notion as a page.</p>
<p><strong>Point the form at Formkove.</strong> Create a form at <a href="https://app.formkove.com/signup?ref=hashnode">app.formkove.com</a> and use its endpoint as the action. No server and no script, and the <code>_gotcha</code> honeypot is on by default.</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions" method="POST"&gt;
</code></pre>
<p><strong>Connect Notion.</strong> Create the internal integration and share the database with it, as in the steps above. Then, in the form's <strong>Integrations</strong>, click <strong>Connect Notion</strong>, paste the secret and pick the database. The secret is stored encrypted and never shown again.</p>
<p><strong>Map the properties.</strong> Formkove lists the database's properties. For each one you pick a form field, a Formkove value (Submitted at, Submission ID, Form name, Sentiment, Tags, Spam score, File links) or a fixed text like <code>Website</code>. Properties with the same name as a form field are filled in for you. It writes title, text, number, checkbox, select, multi-select, status, date, email, phone and URL properties and converts each value to the property's type. Rename or add a property in Notion and you fix it with <strong>Edit mapping</strong>, without touching code. Click <strong>Send test</strong> to add a sample page.</p>
<p><strong>Send only some submissions.</strong> Describe your tags in plain words on the form's <strong>AI &amp; Spam</strong> page (for example, <code>sales-lead</code>: wants a quote, a price or to hire us), then add a routing rule to the Notion connection:</p>
<ul>
<li><strong>Tag</strong> has any of <code>sales-lead</code></li>
</ul>
<p>Now the database only gets leads, and you can map <strong>Sentiment</strong> and <strong>Tags</strong> to their own properties. Rules can also test any form field, like <code>budget</code> is greater than <code>5000</code>. Email isn't routed: you still get every real submission by email.</p>
<p>What comes with it:</p>
<ul>
<li><strong>Spam held back</strong> before anything reaches Notion, so your database stays clean. It's kept in your dashboard for 30 days in case one was a real message.</li>
<li><strong>Every submission saved</strong>, even when Notion is down or refuses a page. Failed deliveries are retried and listed in <strong>Delivery history</strong> with the reason.</li>
<li><strong>Select and status handled.</strong> If Notion refuses a value, Formkove saves the page without its select and status properties instead of losing it, and the delivery history says so.</li>
<li><strong>Long messages kept.</strong> Text goes in whole, up to 50,000 characters, split into Notion's 2,000-character items for you.</li>
<li><strong>Rate limits</strong> on every form: 10 a minute and 30 an hour per IP address.</li>
</ul>
<p>Notion, tags and routing are on the Pro and Agency plans, and Free accounts get them on their <a href="https://formkove.com/docs/limits/?ref=hashnode#your-first-50-submissions-on-free">first 50 submissions</a> (<a href="https://formkove.com/pricing/?ref=hashnode">pricing</a>). Setup details are in the <a href="https://formkove.com/docs/notion-integration/?ref=hashnode">Notion docs</a>.</p>
<hr />
<p><em>Originally published on</em> <a href="https://formkove.com/blog/html-form-to-notion/?ref=hashnode"><em>formkove.com</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to send an HTML form to Airtable]]></title><description><![CDATA[Save contact form submissions as Airtable records, a small Worker, the limits that break it, and a backend that maps the fields]]></description><link>https://formkove.hashnode.dev/how-to-send-an-html-form-to-airtable</link><guid isPermaLink="true">https://formkove.hashnode.dev/how-to-send-an-html-form-to-airtable</guid><category><![CDATA[webdev]]></category><category><![CDATA[airtable]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Fri, 20 Nov 2026 02:39:42 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc60673c0ad99dcb94d8cd/2a8b1274-d46d-4613-a05b-57b8bb385950.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Airtable is a good home for form submissions you want to work through. Each one becomes a record you can assign, give a status and link to a client, and the team sees it in a view instead of an inbox.</p>
<p>Airtable's own forms do this, but they live on Airtable's page. If the form is already on your site, in plain HTML or React or Astro, something has to take the post and call Airtable's API. This guide does it two ways: a small Cloudflare Worker you run yourself, and a form backend that does the mapping for you.</p>
<h2>Why the browser can't call Airtable directly</h2>
<p>Airtable's API takes a personal access token. Anything in your page's JavaScript is public, so a token in the browser lets anyone write records to your base, as many as they like, and read them too if the token has read access.</p>
<p>So the form posts to a small server of yours, and only that server holds the token.</p>
<h2>Option A: a Cloudflare Worker</h2>
<h3>Set up the table</h3>
<p>Create a table with three columns: <strong>Name</strong> and <strong>Email</strong> (single line text) and <strong>Message</strong> (long text). Then create a token at <a href="https://airtable.com/create/tokens">airtable.com/create/tokens</a>:</p>
<ol>
<li>Add one scope: <code>data.records:write</code></li>
<li>Under <strong>Access</strong>, add only this base</li>
<li>Create it and copy the token</li>
</ol>
<p>You also need the base ID. Open the base and it's the part of the URL that starts with <code>app</code>.</p>
<h3>The Worker</h3>
<pre><code class="language-js">// Form field name → Airtable column name
const COLUMNS = { name: "Name", email: "Email", message: "Message" };
const ALLOWED_ORIGIN = "https://example.com";

export default {
  async fetch(request, env) {
    const headers = { "Access-Control-Allow-Origin": ALLOWED_ORIGIN };
    if (request.method !== "POST") return new Response("Method not allowed", { status: 405 });

    const form = await request.formData();

    // Honeypot filled in: answer OK so the bot learns nothing.
    if (form.get("_gotcha")) return Response.json({ ok: true }, { headers });

    const fields = {};
    for (const [field, column] of Object.entries(COLUMNS)) {
      const value = String(form.get(field) ?? "").trim().slice(0, 5000);
      if (value) fields[column] = value;
    }
    if (!fields.Email) return Response.json({ ok: false }, { status: 400, headers });

    const res = await fetch(
      `https://api.airtable.com/v0/${env.AIRTABLE_BASE_ID}/${encodeURIComponent(env.AIRTABLE_TABLE)}`,
      {
        method: "POST",
        headers: {
          Authorization: `Bearer ${env.AIRTABLE_TOKEN}`,
          "Content-Type": "application/json",
        },
        body: JSON.stringify({ records: [{ fields }], typecast: true }),
      },
    );

    if (!res.ok) {
      console.error("Airtable error", res.status, await res.text());
      return Response.json({ ok: false }, { status: 502, headers });
    }
    return Response.json({ ok: true }, { headers });
  },
};
</code></pre>
<p>Change <code>ALLOWED_ORIGIN</code> to your site. Then deploy it and store the token as a secret, so it never sits in your code:</p>
<pre><code class="language-bash">npx wrangler deploy
npx wrangler secret put AIRTABLE_TOKEN
</code></pre>
<p>Add <code>AIRTABLE_BASE_ID</code> and <code>AIRTABLE_TABLE</code> (the table's name) as variables in <code>wrangler.jsonc</code> or the dashboard.</p>
<p><code>typecast: true</code> tells Airtable to convert the text it gets, so <code>42</code> lands in a number column and a date string in a date column. Without it, every value has to match its column type exactly.</p>
<h3>The form</h3>
<p>The Worker answers with JSON, so post with <code>fetch()</code> and show the thank-you message on your own page. A <code>FormData</code> body doesn't need a CORS preflight, which keeps the Worker short.</p>
<pre><code class="language-html">&lt;form id="contact"&gt;
  &lt;input name="name" placeholder="Name" required&gt;
  &lt;input name="email" type="email" placeholder="Email" required&gt;
  &lt;textarea name="message" placeholder="Message" required&gt;&lt;/textarea&gt;
  &lt;!-- Honeypot: hidden from people, bots fill it in --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;
  &lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
  &lt;p id="status" role="status"&gt;&lt;/p&gt;
&lt;/form&gt;

&lt;script&gt;
  const form = document.getElementById("contact");
  const status = document.getElementById("status");
  form.addEventListener("submit", async (event) =&gt; {
    event.preventDefault();
    status.textContent = "";
    try {
      const res = await fetch("https://your-worker.your-subdomain.workers.dev", {
        method: "POST",
        body: new FormData(form),
      });
      if (res.ok) {
        form.replaceWith("Thanks, we got your message.");
        return;
      }
    } catch {}
    status.textContent = "Something went wrong. Please try again.";
  });
&lt;/script&gt;
</code></pre>
<p>Submit it once and a record should show up in the table.</p>
<h3>Where it breaks</h3>
<ul>
<li><strong>Column names have to match.</strong> Rename <strong>Email</strong> to <strong>Email address</strong> in Airtable and every submission fails with <code>UNKNOWN_FIELD_NAME</code> until you change the Worker. Airtable also accepts field IDs (<code>fld…</code>) instead of names, and those survive a rename.</li>
<li><strong>Select columns.</strong> With <code>typecast</code>, a value that isn't an option yet gets added as a new one, if the token's owner can change the base. If they can't, the whole record is refused.</li>
<li><strong>Rate limits.</strong> Airtable allows 5 requests a second per base and answers <code>429</code> above that. The Worker doesn't retry, so a burst loses submissions.</li>
<li><strong>The monthly allowance.</strong> Airtable's Free plan includes 1,000 API calls a month. A bot posting to your form can use that up in an afternoon, and then nothing saves until next month.</li>
<li><strong>No second copy.</strong> When Airtable is down or refuses a record, the Worker logs an error and the submission is gone. Fixing that means a queue and retries.</li>
<li><strong>Spam.</strong> The honeypot only stops simple bots. Written sales pitches get through and become records, and each one counts against your API calls.</li>
</ul>
<p>For a personal site with a few messages a week, the Worker is fine. Past that, most of the work is in the list above.</p>
<h2>Option B: a form backend that maps the fields</h2>
<p>With <a href="https://formkove.com/?ref=hashnode">Formkove</a>, the form posts to a Formkove URL. Each submission is saved, checked for spam, emailed to you and added to Airtable as a record.</p>
<p><strong>Point the form at Formkove.</strong> Create a form at <a href="https://app.formkove.com/signup?ref=hashnode">app.formkove.com</a> and use its endpoint as the action. No server and no script, and the <code>_gotcha</code> honeypot is on by default.</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions" method="POST"&gt;
</code></pre>
<p><strong>Connect Airtable.</strong> Create a token with the <code>data.records:write</code> and <code>schema.bases:read</code> scopes and add your base under <strong>Access</strong>. Then, in the form's <strong>Integrations</strong>, click <strong>Connect Airtable</strong>, paste the token and pick the base and table. The token is stored encrypted and never shown again.</p>
<p><strong>Map the fields.</strong> Formkove lists the table's columns. For each one you pick a form field, a Formkove value (Submitted at, Submission ID, Sentiment, Tags, Spam score, File links) or a fixed text like <code>Website</code>. Columns with the same name as a form field are filled in for you, so <code>Full Name</code> matches <code>full_name</code>. Rename a column in Airtable and you fix it with <strong>Edit mapping</strong>, without touching code. Click <strong>Send test</strong> to add a sample record.</p>
<p><strong>Send only some submissions.</strong> Describe your tags in plain words on the form's <strong>AI &amp; Spam</strong> page (for example, <code>sales-lead</code>: wants a quote, a price or to hire us), then add a routing rule to the Airtable connection:</p>
<ul>
<li><strong>Tag</strong> has any of <code>sales-lead</code></li>
</ul>
<p>Now the table only gets leads, and you can map <strong>Sentiment</strong> and <strong>Tags</strong> to their own columns. Rules can also test any form field, like <code>budget</code> is greater than <code>5000</code>. Email isn't routed: you still get every real submission by email.</p>
<p>What comes with it:</p>
<ul>
<li><strong>Spam held back</strong> before anything reaches Airtable, so it doesn't use your API calls. It's kept in your dashboard for 30 days in case one was a real message.</li>
<li><strong>Every submission saved</strong>, even when Airtable is down or refuses a record. Failed deliveries are retried and listed in <strong>Delivery history</strong> with the reason.</li>
<li><strong>Select columns handled.</strong> If Airtable refuses a new select option, Formkove saves the record without its select columns instead of losing it.</li>
<li><strong>Rate limits</strong> on every form: 10 a minute and 30 an hour per IP address.</li>
</ul>
<p>Airtable, tags and routing are on the Pro and Agency plans, and Free accounts get them on their <a href="https://formkove.com/docs/limits/?ref=hashnode#your-first-50-submissions-on-free">first 50 submissions</a> (<a href="https://formkove.com/pricing/?ref=hashnode">pricing</a>). Setup details are in the <a href="https://formkove.com/docs/airtable-integration/?ref=hashnode">Airtable docs</a>.</p>
<hr />
<p><em>Originally published on</em> <a href="https://formkove.com/blog/html-form-to-airtable/?ref=hashnode"><em>formkove.com</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to send an HTML form to Google Sheets]]></title><description><![CDATA[Save contact form submissions to a Google Sheet: the Apps Script web app, the traps that break it, and a backend that creates the sheet for you.]]></description><link>https://formkove.hashnode.dev/html-form-to-google-sheets</link><guid isPermaLink="true">https://formkove.hashnode.dev/html-form-to-google-sheets</guid><category><![CDATA[webdev]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[HTML]]></category><category><![CDATA[google sheets]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Tue, 17 Nov 2026 23:59:01 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc60673c0ad99dcb94d8cd/6c6650fd-b482-4214-b3f2-7e75f6a654ad.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A Google Sheet is the place a lot of people want form submissions to end up. Everyone on the team can open it, filter it and add a "called back?" column, and nobody has to log in to another tool.</p>
<p>Sheets can't take a form post by itself, though. Something has to receive the submission and write the row. This guide does it two ways: a free Google Apps Script web app you set up yourself, and a form backend that creates the sheet and fills it for you.</p>
<h2>1. Option A: Google Apps Script</h2>
<h3>Set up the sheet</h3>
<p>Create a new spreadsheet and type these headers in row 1, one per column:</p>
<table>
<thead>
<tr>
<th>timestamp</th>
<th>name</th>
<th>email</th>
<th>message</th>
</tr>
</thead>
</table>
<p>Each header has to match a field <code>name</code> in your form exactly, including case. That's how the script knows which value goes in which column. The script writes to the tab named in <code>SHEET_NAME</code> (<code>Sheet1</code> by default).</p>
<h3>Add the script</h3>
<p>In the sheet, open <strong>Extensions → Apps Script</strong>, delete what's there and paste this. Replace <code>YOUR_SPREADSHEET_ID</code> with the ID from your sheet's URL (<code>docs.google.com/spreadsheets/d/YOUR_SPREADSHEET_ID/edit</code>), and update <code>SHEET_NAME</code> if you renamed the tab:</p>
<pre><code class="language-js">const SPREADSHEET_ID = "YOUR_SPREADSHEET_ID";
const SHEET_NAME = "Sheet1";

function doPost(e) {
  const data = JSON.parse(e.postData.contents || "{}");

  // Honeypot filled in: answer OK so the bot learns nothing.
  if (data._gotcha) return json({ ok: true });

  const sheet = SpreadsheetApp.openById(SPREADSHEET_ID).getSheetByName(SHEET_NAME);
  if (!sheet) return json({ ok: false, error: "Sheet not found" });
  const headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];

  const row = headers.map((header) =&gt; {
    if (header === "timestamp") return new Date();
    const value = String(data[header] || "").slice(0, 5000);
    // A value starting with = + - or @ would run as a formula. The ' keeps it as text.
    return /^[=+\-@]/.test(value) ? "'" + value : value;
  });

  sheet.appendRow(row);
  return json({ ok: true });
}

function json(data) {
  return ContentService.createTextOutput(JSON.stringify(data))
    .setMimeType(ContentService.MimeType.JSON);
}
</code></pre>
<h3>Deploy it as a web app</h3>
<ol>
<li>Click <strong>Deploy → New deployment</strong>, then the gear icon and <strong>Web app</strong>.</li>
<li>Set <strong>Execute as</strong> to <strong>Me</strong> and <strong>Who has access</strong> to <strong>Anyone</strong>.</li>
<li>Click <strong>Deploy</strong> and allow access. Google shows "Google hasn't verified this app" because the script is yours and unreviewed. Click <strong>Advanced</strong>, then <strong>Go to (your project)</strong>.</li>
<li>Copy the <strong>Web app URL</strong>. It looks like <code>https://script.google.com/macros/s/AKfy…/exec</code>.</li>
</ol>
<h3>The form</h3>
<p>The web app answers on a Google domain, so a plain <code>&lt;form action&gt;</code> would leave your visitor on a page of JSON. Send it with <code>fetch()</code> instead and show the thank-you message on your own page:</p>
<pre><code class="language-html">&lt;form id="contact"&gt;
  &lt;input name="name" placeholder="Name" required&gt;
  &lt;input name="email" type="email" placeholder="Email" required&gt;
  &lt;textarea name="message" placeholder="Message" required&gt;&lt;/textarea&gt;
  &lt;!-- Honeypot: hidden from people, bots fill it in --&gt;
  &lt;div aria-hidden="true" style="position:absolute; left:-9999px"&gt;
    &lt;input type="text" name="_gotcha" tabindex="-1" autocomplete="off"&gt;
  &lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
  &lt;p id="status" role="status"&gt;&lt;/p&gt;
&lt;/form&gt;

&lt;script&gt;
  const form = document.getElementById("contact");
  const status = document.getElementById("status");
  form.addEventListener("submit", async (event) =&gt; {
    event.preventDefault();
    status.textContent = "";
    try {
      // No Content-Type header, so the browser sends it as text/plain and skips the CORS preflight.
      const res = await fetch("https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec", {
        method: "POST",
        body: JSON.stringify(Object.fromEntries(new FormData(form))),
      });
      if (res.ok &amp;&amp; (await res.json()).ok === true) {
        form.replaceWith("Thanks, we got your message.");
        return;
      }
    } catch {}
    status.textContent = "Something went wrong. Please try again.";
  });
&lt;/script&gt;
</code></pre>
<p>Submit it once and a row should show up in the sheet.</p>
<h3>The traps</h3>
<p>Most "it stopped working" questions about this setup come down to one of these:</p>
<ul>
<li><strong>Edits don't go live on their own.</strong> The <code>/exec</code> URL keeps running the version you deployed. After every change, open <strong>Deploy → Manage deployments</strong>, edit the deployment and pick <strong>New version</strong>, or you'll be debugging code that isn't running.</li>
<li><strong>A missing tab.</strong> If the form shows an error, check that <code>SHEET_NAME</code> matches the tab. The script can return <code>{ "ok": false }</code> with HTTP <code>200</code>, so the form checks the response body too.</li>
<li><strong>Don't set a JSON content type.</strong> A <code>Content-Type: application/json</code> header makes the browser send a CORS preflight first, and Apps Script can't answer it, so the request fails. Leave the header off like the code above. The script parses the body as JSON either way.</li>
<li><strong>Formulas run.</strong> <code>appendRow</code> treats a value starting with <code>=</code> as a formula, so a visitor can put <code>=IMPORTXML(...)</code> in your sheet. The <code>'</code> prefix in the script stops that. Leave it in.</li>
<li><strong>New fields need a new column.</strong> Add a <code>phone</code> field to the form and nothing saves it until you add a <code>phone</code> header by hand.</li>
</ul>
<h3>What this version doesn't do</h3>
<p>For a personal site it's free and it works. What it leaves out:</p>
<ul>
<li><strong>Spam.</strong> The URL is public and in your page source. Anyone can post to it as often as they like, and the honeypot only stops simple bots. LLM-written sales pitches get through and become rows.</li>
<li><strong>Notifications.</strong> Nobody hears about a new row unless they open the sheet. Emailing yourself means more script (<code>MailApp</code>) and more quota.</li>
<li><strong>A second copy.</strong> If the script errors or the sheet is renamed, the submission is lost and nothing tells you.</li>
<li><strong>Sorting.</strong> Every submission lands in the same sheet. Sending only sales leads there means writing the rules, and deciding which messages are leads.</li>
</ul>
<h2>2. Option B: a form backend that creates the sheet</h2>
<p>With <a href="https://formkove.com/?ref=hashnode">Formkove</a>, the form posts to a Formkove URL. Each submission is saved, checked for spam, emailed to you, and added to the sheet as a row.</p>
<p><strong>Point the form at Formkove.</strong> Create a form at <a href="https://app.formkove.com/signup?ref=hashnode">app.formkove.com</a> and use its endpoint as the action. No script is needed, and the <code>_gotcha</code> honeypot is on by default.</p>
<pre><code class="language-html">&lt;form action="https://app.formkove.com/api/forms/YOUR_FORM_ID/submissions" method="POST"&gt;
</code></pre>
<p><strong>Connect Google Sheets.</strong> In the form's <strong>Integrations</strong>, click <strong>Connect Google Sheets</strong>, then <strong>Connect Google</strong>, and pick your account. Formkove creates a new spreadsheet in your Drive. Click <strong>Test</strong> to add a sample row and <strong>Open sheet</strong> to see it.</p>
<p>Formkove only asks for access to the files it creates, so it can't open your other spreadsheets. You can remove that access in your Google account at any time, and deleting the connection keeps the sheet and its rows.</p>
<p><strong>How the rows look.</strong> Each row starts with <strong>Submitted at</strong> and <strong>Submission ID</strong>. Every form field gets its own column the first time it shows up, so a new <code>phone</code> field just adds a column. Columns are matched by name, so you can reorder them or add your own (status, notes) and new rows still land in the right place. Values are written as plain text and numbers, so a submitted <code>=IMPORTXML(...)</code> stays text.</p>
<p><strong>Send only some submissions.</strong> Describe your tags in plain words on the form's <strong>AI &amp; Spam</strong> page (for example, <code>sales-lead</code>: wants a quote, a price or to hire us), then add a routing rule to the Sheets connection:</p>
<ul>
<li><strong>Tag</strong> has any of <code>sales-lead</code></li>
</ul>
<p>Now the sheet only gets leads, with <strong>Sentiment</strong> and <strong>Tags</strong> columns next to the fields. Rules can also test any form field, like <code>budget</code> is greater than <code>5000</code>. Email isn't routed: you still get every real submission by email.</p>
<p>What comes with it:</p>
<ul>
<li><strong>Spam held back</strong> before anything reaches the sheet, kept in your dashboard for 30 days in case one was a real message.</li>
<li><strong>Every submission saved</strong>, even when Google is down or the sheet was deleted. Failed deliveries are retried and listed in <strong>Delivery history</strong>.</li>
<li><strong>Rate limits</strong> on every form: 10 a minute and 30 an hour per IP address.</li>
</ul>
<p>Google Sheets, tags and routing are on the Pro and Agency plans, and Free accounts get them on their <a href="https://formkove.com/docs/limits/?ref=hashnode#your-first-50-submissions-on-free">first 50 submissions</a> (<a href="https://formkove.com/pricing/?ref=hashnode">pricing</a>). Setup details are in the <a href="https://formkove.com/docs/google-sheets-integration/?ref=hashnode">Google Sheets docs</a>.</p>
<hr />
<p><em>Originally published on</em> <a href="https://formkove.com/blog/html-form-to-google-sheets/?ref=hashnode"><em>formkove.com</em></a><em>.</em></p>
]]></content:encoded></item><item><title><![CDATA[How to stop contact form spam]]></title><description><![CDATA[Honeypots, time checks, rate limits, Turnstile, reCAPTCHA and AI filtering compared, with code for each.]]></description><link>https://formkove.hashnode.dev/how-to-stop-contact-form-spam</link><guid isPermaLink="true">https://formkove.hashnode.dev/how-to-stop-contact-form-spam</guid><category><![CDATA[Web Development]]></category><category><![CDATA[HTML]]></category><category><![CDATA[Security]]></category><category><![CDATA[Tutorial]]></category><dc:creator><![CDATA[HARSIMRAN JEET SINGH]]></dc:creator><pubDate>Tue, 17 Nov 2026 14:53:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afc60673c0ad99dcb94d8cd/39628a82-c65b-4025-99be-0b3bbcaade7b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Contact form spam comes from three places:</p>
<ol>
<li><strong>Bots that fill in every field</strong> they find on the page.</li>
<li><strong>Scripts that POST straight to your form's URL</strong>, never loading the page at all.</li>
<li><strong>People and AI tools writing real-looking messages</strong>: SEO offers, "I noticed your website…" pitches, crypto and loan offers.</li>
</ol>
<p>Each defense below stops some of these and misses others. The cheap ones go first.</p>
<h2>1. Honeypot field</h2>
<p>Add a field that people never see. Bots fill it in; people leave it empty. If it has a value, drop the submission.</p>
<pre><code class="language-html">&lt;div class="hp" aria-hidden="true"&gt;
  &lt;label&gt;Leave this empty &lt;input type="text" name="website_url" tabindex="-1" autocomplete="off"&gt;&lt;/label&gt;
&lt;/div&gt;

&lt;style&gt;
  .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
&lt;/style&gt;
</code></pre>
<p>Tips:</p>
<ul>
<li>Use a believable name like <code>website_url</code> or <code>company_fax</code>. A field called <code>honeypot</code> is easy for a bot to skip.</li>
<li>Hide it with a class, not only <code>display:none</code> inline: some bots skip inputs with inline hiding.</li>
<li><code>tabindex="-1"</code> and <code>aria-hidden</code> keep keyboard and screen reader users out of it. <code>autocomplete="off"</code> stops password managers and autofill from filling it.</li>
<li>Reject it quietly: answer as if it worked, so the bot doesn't learn to avoid the field.</li>
</ul>
<p><strong>Stops:</strong> simple bots. <strong>Misses:</strong> scripts that POST directly (they only send the fields they know), and anything human-written.</p>
<h2>2. Time check</h2>
<p>People take more than a few seconds to fill in a form. Many bots submit instantly. Record when the form loaded and reject anything sent too fast.</p>
<pre><code class="language-html">&lt;input type="hidden" name="loaded_at" id="loaded_at"&gt;
&lt;script&gt;
  document.getElementById("loaded_at").value = Date.now();
&lt;/script&gt;
</code></pre>
<p>On your server, reject the submission if <code>Date.now() - loaded_at</code> is under about 3 seconds, or if the field is missing. This needs your own backend, and a bot that waits or fakes the value gets through, so treat it as a filter for lazy bots only.</p>
<h2>3. Rate limits</h2>
<p>Limit how many submissions one IP address can send per minute and per hour. It won't stop a single spam message, but it stops one bot from sending hundreds and keeps a flood from filling your inbox or your plan's quota. Most form backends and hosting platforms do this for you; on your own server, put the limit in front of anything that sends email.</p>
<h2>4. A challenge: Turnstile, reCAPTCHA or hCaptcha</h2>
<p>A challenge widget checks the browser and gives the form a token. Your server then verifies the token with the provider. This stops scripts that POST directly, since they have no valid token.</p>
<table>
<thead>
<tr>
<th></th>
<th>Cloudflare Turnstile</th>
<th>Google reCAPTCHA</th>
<th>hCaptcha</th>
</tr>
</thead>
<tbody><tr>
<td>What visitors see</td>
<td>Usually nothing, sometimes a checkbox</td>
<td>v2: checkbox and image puzzles. v3: nothing, you get a score</td>
<td>Checkbox, sometimes image puzzles</td>
</tr>
<tr>
<td>Privacy</td>
<td>No ad tracking, no cookies for tracking</td>
<td>Runs on Google and uses Google cookies</td>
<td>Privacy-focused</td>
</tr>
<tr>
<td>Cost</td>
<td>Free</td>
<td>Free up to a monthly allowance, then paid through Google Cloud</td>
<td>Free tier, paid plans for more</td>
</tr>
</tbody></table>
<p>Turnstile is the easiest choice for most contact forms: free, rarely visible, and it doesn't send your visitors to Google.</p>
<p>Add the widget:</p>
<pre><code class="language-html">&lt;script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer&gt;&lt;/script&gt;

&lt;form action="/contact" method="POST"&gt;
  &lt;!-- your fields --&gt;
  &lt;div class="cf-turnstile" data-sitekey="YOUR_SITE_KEY"&gt;&lt;/div&gt;
  &lt;button type="submit"&gt;Send&lt;/button&gt;
&lt;/form&gt;
</code></pre>
<p>Then <strong>verify the token on your server</strong>. The widget alone does nothing: a bot can skip it and post the form anyway.</p>
<pre><code class="language-js">const result = await fetch("https://challenges.cloudflare.com/turnstile/v0/siteverify", {
  method: "POST",
  body: new URLSearchParams({
    secret: process.env.TURNSTILE_SECRET_KEY,
    response: formData.get("cf-turnstile-response"),
  }),
}).then((res) =&gt; res.json());

if (!result.success) {
  // reject the submission
}
</code></pre>
<p><strong>Stops:</strong> bots and direct POSTs. <strong>Misses:</strong> people pasting a pitch into your form by hand, and AI agents driving a real browser.</p>
<h2>5. Content filtering</h2>
<p>What gets past everything above is usually written by a person or by an AI tool: a real browser, a real pause, a valid token, and a message nobody wants. To catch it you have to look at what the message says.</p>
<ul>
<li><strong>Rules:</strong> block messages with more than a few links, or with a link in the name field. Cheap, and spammers adapt.</li>
<li><strong>Akismet:</strong> a spam-checking service from Automattic, built into many WordPress setups. Free for personal sites, paid for commercial ones.</li>
<li><strong>AI classification:</strong> a model classifies each submission and scores how likely it is to be spam. It catches pitches that rules miss, because it judges the message the way you would.</li>
</ul>
<p>Any content filter makes mistakes sometimes. <strong>Quarantine, don't delete:</strong> hold flagged messages somewhere you can check, and let a real lead through with one click.</p>
<h2>6. Validate on the server</h2>
<p>Whatever you add in the browser, check it again on the server: required fields present, a valid email address, reasonable lengths, and only the fields you expect. Bots don't run your JavaScript, so browser-side checks don't count.</p>
<h2>What to use</h2>
<table>
<thead>
<tr>
<th>Situation</th>
<th>Use</th>
</tr>
</thead>
<tbody><tr>
<td>A personal site with a little spam</td>
<td>Honeypot + rate limits</td>
</tr>
<tr>
<td>A business site, or spam reaching you daily</td>
<td>Honeypot + Turnstile + rate limits</td>
</tr>
<tr>
<td>Spam that looks hand-written (SEO and sales pitches)</td>
<td>Add content filtering, with a quarantine you check weekly</td>
</tr>
<tr>
<td>Forms where a lost lead costs money</td>
<td>All of the above, and never auto-delete</td>
</tr>
</tbody></table>
<p>Order matters for cost too: let the honeypot and Turnstile reject bots first, so only messages from real browsers reach the content filter.</p>
<h2>Doing this with Formkove</h2>
<p>If you'd rather not build it, a form backend does this for you. With <a href="https://formkove.com/?ref=hashnode">Formkove</a>:</p>
<ul>
<li><strong>Rate limits</strong> are on for every form: 10 submissions per minute and 30 per hour per IP.</li>
<li><strong>The AI spam filter</strong> checks each submission before anything is sent, on every plan (on by default). Spam is held in your dashboard for 30 days, and <strong>Not spam, deliver</strong> sends a false positive on to its destinations.</li>
<li><strong>Honeypot</strong>: on by default for new forms, with the field name <code>_gotcha</code>. Add the hidden input from section 1 with that name. You can rename or clear it on the form's <strong>AI &amp; Spam</strong> page.</li>
<li><strong>Turnstile</strong>: paste your own site and secret keys; Formkove verifies the token on every submission.</li>
</ul>
<p>Submissions the AI flags still count toward your monthly limit. Submissions stopped by the honeypot or Turnstile don't, so turn both on if a form attracts a lot of bots. Setup steps are in the <a href="https://formkove.com/docs/spam-protection/?ref=hashnode">spam protection docs</a>, and the free plan includes 300 submissions a month.</p>
<hr />
<p><em>Originally published on</em> <a href="https://formkove.com/blog/stop-contact-form-spam/?ref=hashnode"><em>formkove.com</em></a><em>.</em></p>
]]></content:encoded></item></channel></rss>