No server runtime to add
Hugo emits static files and stops there: there's no runtime to receive a POST. Posting to an external endpoint means you never bolt a serverless function onto your build just to run a form.
integrations · static site generator
Hugo has no server runtime: it compiles your whole site to static HTML at build time, so there's nothing running to receive a form submission. Point a plain <form> at your mailcontact endpoint instead and submissions land in your project's inbox, with a notification in Discord, Slack, email, or a webhook. No serverless function, no mail service, no Hugo module.
Because Hugo templates output plain HTML, the form lives in a single partial (layouts/partials/contact-form.html) that you pull into any page, layout, or shortcode with {{ partial "contact-form.html" . }}. Write it once, reuse it everywhere.
The built site is just files, so it deploys (and the form keeps working) on any static host: GitHub Pages, Cloudflare Pages, Netlify, or an S3 bucket behind a CDN.
the snippet
Point the form at your project's mailcontact endpoint. Submissions land in your project inbox. No server, no API route, no email service to wire up.
{{/* layouts/partials/contact-form.html */}}
<form action="https://mailcontact.app/api/forms/your-form-id" method="POST">
<label for="name">Name</label>
<input type="text" id="name" name="name" />
<label for="email">Email</label>
<input type="email" id="email" name="email" required />
<label for="message">Message</label>
<textarea id="message" name="message" required></textarea>
<button type="submit">Send</button>
</form>how it works
One inbox per project. Name it after your site and you get a form endpoint and a project email address immediately.
Save the snippet as layouts/partials/contact-form.html, then {{ partial "contact-form.html" . }} on your contact page or in a layout. It's your markup; style it with your theme's CSS.
Add a Discord, Slack, email, or webhook channel. Every submission pings you where you already are.
why mailcontact
Hugo emits static files and stops there: there's no runtime to receive a POST. Posting to an external endpoint means you never bolt a serverless function onto your build just to run a form.
Define contact-form.html once and pull it into any single page, list template, or shortcode with {{ partial }}. Change the form in one place and every page updates.
The form is part of your static output, so it travels with the site to GitHub Pages, Cloudflare Pages, Netlify, or an S3 bucket. No host-specific form feature required.
faq
No. Hugo only builds static HTML, so the form posts directly to your mailcontact endpoint, which stores the message and sends your notifications. Nothing runs on your side.
Yes. The endpoint accepts posts from any origin, so the form works wherever your Hugo output is served, including hosts with no form handling of their own, like GitHub Pages or a plain S3 bucket.
Completely. mailcontact only receives the POST. The markup in the partial is yours, so your theme's stylesheet applies. Add classes, rearrange fields, or wrap it in your own layout.
Add a few lines of JavaScript that intercept submit and POST the fields with fetch, then swap in a thank-you message (the endpoint returns JSON like {"ok": true}). A configurable redirect for native form posts is coming with the launch.
related
Forms and a real email address, together, with notifications where you live. Launching soon. Be the first to know.