Forms — Denzel Next.js
The one form of this Next.js template works as soon as you run it: the newsletter box in the footer of every page (“Join 89,000 subscribers!”).
It is sent to a server action (sendNewsletter in src/lib/actions.ts). It checks the e-mail in the browser and again on the server, shows “…” on the button while sending, then “Thank you!” and clears the field, or “Something went wrong” and keeps what the visitor typed, and drops spam with a hidden honeypot field.
Out of the box, sign-ups 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.
The quickest way to receive sign-ups
Section titled “The quickest way to receive sign-ups”-
Copy the example settings:
Terminal window cp .env.example .env.local -
Choose one:
You want Set The subscriber in a Mailchimp audience FORM_PROVIDER=mailchimp+MAILCHIMP_API_KEY,MAILCHIMP_AUDIENCE_ID, andMAILCHIMP_STATUS(below)An email for every sign-up FORM_PROVIDER=resend+RESEND_API_KEY,FORM_EMAIL_TO,FORM_EMAIL_FROMIt in another newsletter tool, a spreadsheet, Slack… FORM_PROVIDER=webhook+FORM_WEBHOOK_URL(Zapier, Make, n8n, Formspree, your own API)Several at once work:
FORM_PROVIDER=mailchimp,resend. -
Restart
npm run devand sign up from the footer. -
Put the same variables in your host’s dashboard before deploying.
.env.localis not uploaded.
Details for each provider, the variables, the webhook payload and how to write your own provider (Brevo, ConvertKit, Beehiiv, a database…) are in Forms reference.
What the box sends
Section titled “What the box sends”| Field | Name it arrives under | Required |
|---|---|---|
| E-mail (placeholder “name@email.com”) | email (label “Email”) |
yes, and it must look like an e-mail address |
Every sign-up carries form: "newsletter" and the title “New newsletter subscriber”. Resend emails it to you with that
title as the subject and the subscriber’s address as the reply address. Mailchimp adds or updates the contact, tags it
“New newsletter subscriber” and keeps the submission as a note. A webhook receives:
{ "form": "newsletter", "title": "New newsletter subscriber", "submittedAt": "2026-10-27T10:48:23.256Z", "data": { "email": "jane@example.com" }, "labels": { "email": "Email" }}Mailchimp and consent
Section titled “Mailchimp and consent”The box asks people to subscribe, so if you send it to Mailchimp, set MAILCHIMP_STATUS to pending (Mailchimp sends a
confirmation e-mail first: double opt-in) or subscribed. With the default, transactional, the contact is stored but
can’t receive your campaigns (Forms reference).
Changing the texts
Section titled “Changing the texts”The box’s texts are footer.newsletter in src/content/site.ts:
| Field | Demo |
|---|---|
title |
“Newsletter” |
text |
“Join 89,000 subscribers!” |
placeholder |
“name@email.com” (also the field’s name for screen readers) |
submit |
“Sign Up” |
success |
“Thank you!” |
error |
“Something went wrong” |
note |
“By signing up, you agree to our Privacy Policy” |
The note is plain text: the template has no privacy page. Write your own policy, then add a page for it (Pages and sections) and link it, or change the note.
The title of each sign-up (“New newsletter subscriber”) is set in sendNewsletter in src/lib/actions.ts. To add a
field (a name, for example), add the input to NewsletterForm in src/design-system/components/actions/NewsletterForm.tsx
and its { name, label } to the fields list in sendNewsletter; only the fields listed there are sent.
Testing before launch
Section titled “Testing before launch”- Sign up on your own site after deploying, with a real address.
- Check the destination (audience, inbox, spreadsheet).
- Try a failure on purpose: set a wrong API key, sign up, and confirm the visitor sees “Something went wrong” and the address is still in the field.
The honeypot stops the usual bots: the box 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 use Mailchimp’s double opt-in.
Privacy
Section titled “Privacy”Sign-ups go only where you point them; nothing is sent anywhere else. The box collects an e-mail address: say what happens to it in your privacy policy, keep the destination secure, and check what your country’s rules ask of you. The box has no consent checkbox: add one if your visitors’ country requires it.