All guides

Next.js App Router

Serve a working contact page from an App Router Server 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 app/contact/page.tsx

If the project uses src/app, create src/app/contact/page.tsx instead. Export this component as the route. A string action sends a browser POST directly to Wiztrom.

TSX
export default function Contact() {
  return (
    <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>
  );
}

Visit /contact

Run the project, then deploy the route. This version needs no client directive or Server Action. If you add an inline receipt with fetch, put the submit handler in a separate Client Component with the use client directive.

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