Adding a Contact Form to EmDash is one paste into an HTML block in the EmDash editor, or two lines in your theme's Astro page if you would rather keep it in code. The Helpdesky Contact Form drops in as one container div and one script tag, handles its own validation, and lands every submission in your Helpdesky inbox where you can reply by email.
This guide is for anonymous visitors. There is no login, no HMAC, no backend wiring. If you need a portal for signed in users instead, see the Ticket Center Setup Guide.
Why pick the Helpdesky Contact Form for EmDash, Cloudflare's open source CMS built on Astro? It is free for the first 15 conversations every month, there is no email plugin or SMTP to configure, and nothing to port over from WordPress: the whole thing is one snippet. Every reply you send from your Helpdesky inbox is delivered straight to the visitor's email.
Set Up Your Helpdesk
Open the Helpdesky dashboard and go to Contact Form in the sidebar. Copy the embed snippet at the top of the page. It already has your Helpdesk ID filled in:
<div id="hdh-contact-form"></div>
<script src="https://helpdesky.io/contact-form.js"
data-helpdesk-id="YOUR_HELPDESK_ID"></script>
While you are there, also enable messaging from the Messages sidebar item if you have not already. The toggle is at the top of the Messages page.
Add the Embed Code (HTML Block)
This route needs no code and works on any EmDash theme. The EmDash editor has an HTML block made for exactly this kind of embed.
- Open
/_emdash/adminon your site, select Pages in the sidebar, and open the page where you want the form, or select Add New to create a Contact page. - In the body, type
/and choose HTML. - Paste the snippet into the HTML tab:
<div id="hdh-contact-form"></div>
<script src="https://helpdesky.io/contact-form.js"
data-helpdesk-id="YOUR_HELPDESK_ID"></script>
- Leave the block's menu on Isolated frame, the default for a new HTML block.
- Select Save, then Publish now for a new page or Publish changes for a page that is already live.
An isolated frame runs the block in a sandboxed frame that grows with its content, so the form sizes itself and your theme's styles never bleed into it. Do not switch the block to Inline: inline blocks keep text and images but strip scripts and form controls, so the form would disappear.
One thing to expect inside the editor: the block's Preview tab stays empty, and EmDash notes that the admin's security policy blocked an external script. That is the admin protecting itself, not a problem with the snippet. Your published page has no such restriction, so check the form with Preview draft or on the live page.
Add the Embed Code (Theme File)
Every EmDash site is an Astro project, so you can also give the form a route of its own. Create src/pages/contact.astro next to the theme's other pages and paste the snippet inside the layout:
---
import Base from "../layouts/Base.astro";
---
<Base title="Contact us">
<article>
<h1>Contact us</h1>
<div id="hdh-contact-form"></div>
<script
is:inline
src="https://helpdesky.io/contact-form.js"
data-helpdesk-id="YOUR_HELPDESK_ID"
></script>
</article>
</Base>
The is:inline directive tells Astro to leave the script tag alone instead of bundling it, which matters because the script reads its settings from its own data-* attributes. If your theme already ships a contact page, as the Marketing template does, paste the div and the script into that file instead. Then redeploy: the Cloudflare templates include a pnpm run deploy script, which runs astro build && wrangler deploy.
This route renders the form as part of the page itself rather than inside a sandboxed frame. Pick it if you plan to use Cloudflare Turnstile or Allowed Embed Domains, both covered under Cool Features below.
Test It
Open the contact page in an incognito window and submit a test message. The conversation should land in your Helpdesky Messages inbox within seconds.
If the page shows everything except the form, check the HTML block's menu: a block pasted in from another browser tab is created as Inline, which removes the script, so switch it to Isolated frame and publish again. If the form shows in Preview draft but not on the live site, the change is still a draft; select Publish changes.
Next Steps
Route inbound support email into the same helpdesk by following the Email Forwarding Setup Guide. If you start getting bot submissions, layer on bot protection with the Cloudflare Turnstile Setup Guide. When you ship a signed in dashboard, swap the public form for a Ticket Center so users can see their full conversation history.
Let an AI Agent Answer the Form
Every message sent through the form becomes a conversation in your Messages inbox, and you do not have to answer each one yourself. Open Inbox → AI Agents (beta) and create an agent that drafts replies from your published help articles. In the Mode section choose Review, where the draft waits in the thread for one click approval, or Autopilot, where the agent sends on its own within the pacing and guardrails you set.
Then open Behaviour → Channels and switch on Contact form. From that moment the agent picks up new conversations from your EmDash site, and the visitor receives its answer by email exactly as they would a reply you typed. Review is a sensible first step while you learn what people ask.
Agents run on your own AI provider key, saved under Settings → AI Settings, so add one before you expect any replies. The Set Up Your First AI Agent guide covers creating and testing an agent, and the guardrails and pacing guide explains reply delays, daily caps and when the agent hands a conversation to a human.
Cool Features
A couple of small things you can turn on once the basic form is live.
- Hide outer border: drop the form into any section without a background or border so it blends straight into your theme. From the Contact Form page, open the Layout section and toggle Hide outer border.
- Cloudflare Turnstile spam protection: if your domain is on Cloudflare, and with EmDash it usually is, you can protect the form from bots in a few clicks. Open your Cloudflare account, go to Turnstile, add your domain, generate the keys, and paste them into the Helpdesky Contact Form settings. Full walkthrough in the Cloudflare Turnstile Setup Guide. One EmDash detail: Turnstile has to see the domain of the page it runs on, and an isolated HTML block runs in a sandboxed frame without one, so Turnstile cannot load there. Keep the form in a theme file when you turn it on.
Allowed Embed Domains: stop other sites from loading the form with your Helpdesk ID. Under Settings → Messages → Allowed Embed Domains, add your site's domain; subdomains are included automatically, and an empty list allows every domain. The same caveat applies: a form inside an isolated HTML block sends no origin, so a domain list blocks it. Use this setting with the theme file route, or leave the list empty while the form lives in an HTML block. Details in Restrict Embeds to Specific Domains.
Make the form yours: the Custom Fields section adds Text, Text Area, Dropdown, Checkbox or Number fields between Email and Message, each of them optionally required. Labels, placeholders, the button text and the success text are all editable, so the form can speak your readers' language. Accent Style paints the button with your Branding colours, Use Branding Background and the colour pickers cover the rest, and the Custom CSS section has a View example snippets library (Brand Colors, Dark Mode / Dark Background, Rounded / Pill Style, Flat / Minimal, Custom Fonts, Full-Width Bold Button, Compact Form). The Contact Form Setup Guide lists every option.