Skip to content
Sign inJoin waitlist

Forms — Catchup Next.js

The inquiry form of this Next.js template works as soon as you run it: it is on the Contact page, beside the studio’s details.

It checks the required fields, shows a spinner on its button while sending, says “Thank you” and clears the fields, keeps what the visitor typed when something fails (“Something went wrong”), and drops spam with a hidden honeypot field. It works without JavaScript too.

Out of the box, submissions are written to the server log (FORM_PROVIDER=console). That’s fine while you build, but useless once you publish, so pick a destination before launch.

  1. Copy the example settings:

    Terminal window
    cp .env.example .env.local
  2. Choose one:

    You want Set
    An e-mail for every inquiry FORM_PROVIDER=resend + RESEND_API_KEY, FORM_EMAIL_TO, FORM_EMAIL_FROM
    It in your CRM, Slack, a spreadsheet… FORM_PROVIDER=webhook + FORM_WEBHOOK_URL (Zapier, Make, n8n, Formspree, your own API)
    The sender in a Mailchimp audience FORM_PROVIDER=mailchimp + MAILCHIMP_API_KEY, MAILCHIMP_AUDIENCE_ID

    Several at once work: FORM_PROVIDER=resend,mailchimp.

  3. Restart npm run dev and send a test from the Contact page.

  4. Put the same variables in your host’s dashboard before deploying. .env.local is not uploaded.

Details for each provider, what it receives, the webhook payload, Mailchimp consent settings and how to write your own provider are in Forms reference.

The inquiry on the Contact page (title “New inquiry from the Catchup website”):

Field Name it arrives under Required
Name (“Your name*”) name yes
Email (“Your email*”) email yes
Services: Branding, Design, Development or Photography (pills, one choice or none) service
Budget: Under $5,000, $5,000 – $10,000, $10,000 – $20,000, $20,000+ budget yes
Project Timeline: ASAP, 2–4 Weeks, 1–2 Months, Flexible timeline yes
Message (“Your message”) message

Each field shows its label above it. Budget and Project Timeline are drop-downs that start on an empty choice (“Estimated Budget”, “Project Timeline”), so the visitor has to pick one. Name and Email sit side by side (one under the other on phones), then the service pills, Budget and Timeline side by side, the message across, and the “Submit Inquiry” button with the consent line under it (“By submitting, you agree to our Terms and Privacy Policy”, linking the two legal pages).

Resend puts the sender’s name after the title in the e-mail’s subject and sets the reply address to the sender’s e-mail. Mailchimp stores the name as FNAME, tags the contact with the title and keeps the rest as a note. A webhook receives every field of the form, as "" when left empty, with its label.

The labels, placeholders, choices, the button’s three texts (“Submit Inquiry”, “Thank you”, “Something went wrong”) and the title of each submission are content: contactForm in src/content/pages/contact.ts. A field arrives at your provider under its name, so keep the names you already map somewhere. The consent line is consent in contactPage, in the same file.

The server action (submitContact in src/lib/actions-contact.ts) sends every field listed in contactForm.fields and checks the required ones again on the server, so the list in the copy is the place to edit:

  • To change the choices, edit options of service, budget or timeline. The service pills don’t come from the services collection: if you add a service, add it here too.

  • To make a field required or optional, set or remove required: true. The browser checks it before sending and the server checks it again. A required field must be on the page: if it is only in the list, every submission fails.

  • To add a field, add an entry, for example a company name:

    company: { name: "company", label: "Company", placeholder: "Your company", autoComplete: "organization" },

    The types are text (the default), email, tel, url, select (with options; the placeholder is its empty first choice) and textarea. The fields are laid out by hand, so also place it in the form: <FormField {...form.fields.company} /> in src/components/sections/ContactMain.tsx (add className="md:col-span-2" for a full-width one).

  • To remove a field, delete its entry and its line in ContactMain.tsx (the component picks the fields by name at its top: const { name, email, service, budget, timeline, message } = form.fields).

  • Don’t give a real field the name fax: it is the honeypot’s (Spam).

  • Submit the form on your own site after deploying, with a real address.
  • Check the destination (inbox, spreadsheet, audience) and reply to the test.
  • Try a failure on purpose: set a wrong API key, submit, and confirm the visitor sees “Something went wrong” and their text is still there.

The honeypot stops the usual bots: the form carries a hidden field named fax that a person never sees; a bot that fills it is shown “Thank you” and nothing is sent. If you start getting spam anyway, put a service in front through the webhook provider (Formspree, Web3Forms and Basin all include spam filtering), or add a captcha to the form component.

Submissions go only where you point them; nothing is sent anywhere else. The form collects a name, an e-mail address, the project’s details and a message, and its consent line points to your Terms and Privacy Policy: make sure those pages (Editing the content) say what you do with the data.

The form doesn’t ask for marketing consent, so if you send it to Mailchimp, keep MAILCHIMP_STATUS at transactional (the default): those contacts can get your replies, not your campaigns.