Skip to content
New: Customize your theme with an AI assistant. Read the guide

Forms

Files: src/config/config.toml, form fields in content files, src/i18n/<lang>.json · Skill level: Beginner

Covena’s forms send to a form service you choose: Formsubmit, Formspree or Netlify Forms. The site itself stores nothing and needs no server. Until you connect a service, every form runs in demo mode: it checks the fields, then tells the visitor that nothing was sent.

The Covena consultation form

The Forms And Where Their Fields Are

FormWhere it showsFields and labels
Contact form (“Get in touch”)Home 1 and most inner pagesform in src/content/sections/<language>/contact-split-form.md
Contact page form/contact/form in src/content/contact/<language>/-index.md
Consultation form/consultation/form in src/content/consultation/<language>/-index.md
Callback form (“Ask us to call you back”)Home 3form in src/content/sections/<language>/contact-callback-panel.md
Job application formEvery role page under /careers/application.form in src/content/careers/<language>/-index.md
Newsletter (footer)The columns-light footer (Home 2)[settings.subscription] in config.toml
Newsletter (panel)/insights/src/content/sections/<language>/newsletter.md

The first five share one endpoint. The two newsletter forms are set up separately.

Connect The Forms

Set the endpoint and the service in [settings] of src/config/config.toml:

[settings]
contactFormAction = "" # empty = demo mode
contactFormProvider = "formsubmit.co" # formspree | formsubmit.co | netlify
contactFormAction = "https://formsubmit.co/[email protected]"
contactFormProvider = "formsubmit.co"

No account needed. Formsubmit emails you the first time a form is sent, to confirm the address. Submissions arrive as a table in your inbox.

Each form’s emailSubject becomes the subject line of the email you receive, so you can tell the forms apart: “New consultation request from the Covena Law website”, “New callback request…” and so on.

Send One Form Somewhere Else

Add action to that form’s block. It overrides contactFormAction for this form only. The content files have a commented line ready:

src/content/consultation/english/-index.md
form:
action: "https://formspree.io/f/another-form-id"
emailSubject: "New consultation request from the Covena Law website"

The service setting (contactFormProvider) still applies, so use the same service for every form.

The Newsletter Forms

Footer form (the columns-light footer on Home 2). It sends to Mailchimp:

[settings.subscription]
enable = true
title = "" # empty uses footer.newsletterTitle in src/i18n/<lang>.json
note = "" # empty uses subscription.description in src/i18n/<lang>.json
formAction = "" # your Mailchimp form action
mailchimpTagValue = "" # optional numeric Mailchimp tag ID

To find formAction: in Mailchimp, open Audience > Signup forms > Embedded form and copy the address in <form action="...">. The form signs people up without leaving the page. Set enable = false if you don’t send a newsletter.

Panel on /insights/. It has its own settings in src/content/sections/<language>/newsletter.md:

formAction: "" # your email service's form action
emailFieldName: "email" # use the exact field name your service expects, such as EMAIL
hiddenFields: [] # extra fields your service needs, as name and value pairs

Never put a private key or password in hiddenFields: the page shows them to anyone who views its source. Both newsletter forms run in demo mode while formAction is empty.

Change The Fields

Each form lists its fields under inputs. Edit the labels, add fields or remove them, in every language:

inputs:
- label: "Full name"
name: "Full name" # the name you see in the email
required: true
- label: "Email"
name: "Email"
type: "email"
required: true
halfWidth: true # half the row, next to the following field
- label: "Practice area"
name: "Practice area"
placeholder: "Choose one"
dropdown:
type: "select"
items:
- { label: "Employment", value: "Employment" }
- { label: "Not sure yet", value: "Not sure yet" }
- label: "How can we help?"
name: "Message"
tag: "textarea"
rows: "5"
required: true
- label: "I agree that ... as set out in the [privacy policy](/privacy-policy/)."
id: "home-contact-consent"
name: "Consent"
value: "Yes"
type: "checkbox"
required: true
KeyWhat it does
labelThe text above the field. Markdown links work, as in the consent box
nameThe field name in the email. Keep it the same in every language if you want the emails to match
typetext (default), email, tel, radio or checkbox
tagtextarea for a multi-line field, with rows
requiredtrue makes the field required
halfWidthtrue puts the field in half a row on wide screens
placeholderGrey text inside an empty field
dropdownA list to choose from, with type: "select" and items
minLengthThe fewest characters allowed. Text areas default to 10
idA unique id. Give every checkbox its own

The button is submitButton in the same block. Change its label there.

Messages

The messages after sending are in src/i18n/<lang>.json, in each language:

  • contactForm.success: “Thanks, we’ve got your message. We’ll be in touch within 2 working days.”
  • contactForm.error, contactForm.timeout and contactForm.submitting
  • contactForm.validation: the messages under a field that’s empty or wrong (“This field is required.”, “Please enter a valid email address.” and so on)
  • forms.demo and forms.demoLive: the demo mode notes
  • subscription.*: the newsletter messages

The success message promises a reply within 2 working days. Change it if your firm works to a different time.

Privacy

The forms send what visitors type to the service you chose, so:

  • Name the service in your privacy policy (src/content/pages/<language>/privacy-policy.md).
  • Keep a consent checkbox that links to the privacy policy, as the sample forms do.
  • Ask only for what you need. People often describe sensitive matters in the message box. Consider adding a line asking them not to send confidential details before you’ve agreed to act.

Do It With AI

Connect the Covena forms to Formspree. In src/config/config.toml set contactFormAction to
"[FORMSPREE URL]" and contactFormProvider to "formspree". Send the job application form to
"[SECOND URL]" by adding action to application.form in src/content/careers/<language>/-index.md,
in every language. Set formAction in [settings.subscription] to "[MAILCHIMP URL]". Don't change
the fields. Then run npm run build.
Type something to search...