All guides

Astro

Build a contact route that submits from static HTML without hydrating a component.

Copy your endpoint

Open your form in Wiztrom and copy its endpoint from Setup. Replace the example URL with that address. If you created your form from a template, use the field names and required fields from its Setup HTML.

Create src/pages/contact.astro

Use this as the page or put the form inside your existing layout. Astro outputs an ordinary HTML form at build time.

Astro
<!doctype html>
<html lang="en">
  <head><meta charset="utf-8" /><meta name="viewport" content="width=device-width" /><title>Contact</title></head>
  <body>
    <h1>Contact</h1>
    <form action="https://forms.wiztrom.com/f/YOUR_FORM_ID" method="post">
      <label>Name <input name="name" required /></label>
      <label>Email <input name="email" type="email" required /></label>
      <label>Message <textarea name="message" required></textarea></label>
      <button type="submit">Send message</button>
    </form>
  </body>
</html>

Build and open /contact

Run npm run build and preview the build. The external action works for a statically generated route. If the page shows a 404, check that the file lives under src/pages.

Find the test in your inbox

On the published page, leave a required field empty and try Send. Fill it in, enter a distinctive test message and submit once. Open the form’s Wiztrom inbox and match the submitted values. If you enabled a notification, open delivery history and check its result.

References