The forms — Kendi AI Prompts
Kendi has two kinds of form: the newsletter, in three places, and the contact form. The prompts build each with its states — sending, “Thank you”, “Something went wrong”, each shown on the submit button — and a hidden field that catches spam bots. Both send to the same address, each with its own name, so you can tell them apart.
| Form | Where | form it sends |
Content |
|---|---|---|---|
| Newsletter | Home’s hero; the sidebar’s Newsletter card (Home and every post); the band above the footer (every page but the legal pages and 404) | newsletter |
newsletter.form in src/content/site.json (the hero’s labels: hero.subscribe in pages/home.json) |
| Contact message | The Contact page | contact |
form in src/content/pages/contact.json |
The fields
Section titled “The fields”| Field | Name it sends | Newsletter | Contact |
|---|---|---|---|
email (newsletter), Email (contact) |
required | required | |
| The consent checkbox (the sidebar card and the band) | Newsletter (on when ticked) |
optional | — |
| Name | Name |
— | required |
| Message | Message |
— | required |
Labels, placeholders and button texts are in each form’s content (fields, submit, success and error). An
address the browser doesn’t accept stops the form with the browser’s own message; one without a dot after the @ shows
“Something went wrong” without sending.
Demo mode
Section titled “Demo mode”Until you connect a service, the forms run in demo mode: they wait a moment and say “Thank you”, but nothing is sent anywhere. Connect them before you publish.
Connecting a form service
Section titled “Connecting a form service”The forms send their fields as JSON to the address in an environment variable:
| Tool / framework | Variable |
|---|---|
| Lovable, Bolt, Replit (Vite) | VITE_FORM_ENDPOINT |
| v0 and other Next.js projects | NEXT_PUBLIC_FORM_ENDPOINT |
| Astro | PUBLIC_FORM_ENDPOINT |
- Create a form at a service that accepts JSON posts — for example Formspree or Basin — or a webhook in Zapier, Make or n8n.
- Copy the address it gives you (e.g.
https://formspree.io/f/abcdwxyz). - Set it as the variable above: in the tool’s settings for secrets or environment variables, or in a
.envfile. The address is built into the site, so build or publish again after you change it. - Send each form once and check that the submissions arrive.
Every submission also carries form (newsletter or contact) and subject (“New newsletter subscriber”, or the
contact form’s notification, “New contact message”), which form services use as the email subject. To send the
sign-ups to your mailing list and the messages to your inbox, route the submissions through a Zapier, Make or n8n
webhook and branch on form.
When the service answers with an error, or the network fails, the button says “Something went wrong” and the visitor’s text stays in the fields.
Other ways
Section titled “Other ways”- Your tool’s database: Lovable and some others can save submissions in a database and email you. Ask: “Save the newsletter sign-ups and the contact messages to the database and email me each message.”
- A mailing-list service: Mailchimp, Brevo, Kit or Beehiiv can take the sign-ups through their own form address or a webhook; ask your tool to point only the newsletter there if you like.
- Your own server: the endpoint can be any URL that accepts a JSON POST.
Changing a form
Section titled “Changing a form”The contact form’s fields, their labels and placeholders are content: ask your tool to add or remove a field there and
show it in the form (“Add an optional Subject field after Email in the contact form”). A field arrives at your form
service under its name, so keep the names you already use somewhere.
Privacy and consent
Section titled “Privacy and consent”Submissions go only where you point them. The newsletter’s consent line links the Privacy Policy and the Terms; the
box is optional in the demo. If the law where you publish asks for explicit consent, ask your tool to make the box
required, or use your mailing-list service’s double opt-in. The demo’s legal pages (collections/legal.json) are
sample text: write your own, saying what the forms collect and where it goes.
The hidden fax field stays empty for people and gets filled by bots; when it is filled, the form says “Thank you” and
sends nothing. Most form services also filter spam themselves.