All articles

The contact form and reCAPTCHA keys in Website Kit

Published:

The Contact page of Website Kit has a feedback form. A form that sends messages without a check is not created at all: when the conditions below are not met, the page shows the e-mail and phone from the settings instead.

How the form works

The form posts to the standard method of the site, which validates the address, escapes the text, stores the message (a Communication) and mails the address in Contact Us Settings. The app adds no new open method. Before sending, the page requires the spam protection to work, waits at least 3 seconds after the page opened and does not send when a hidden trap field is filled. The reCAPTCHA v3 token is checked by the spam protection for the contact form.

When the form is shown

The Contact page with the form and the contacts card

The form is shown only when all of these hold:

  1. The spam protection is installed on the site.
  2. The spam protection of the contact form works in the strict mode, that is, it refuses a failed check. In the monitoring mode (the default) it only logs, so a message without a token would be stored; the app then shows no form and makes no claim about a check.
  3. There are usable reCAPTCHA v3 keys for the address the page is served on.
  4. Contact Us Settings is enabled and holds one plain recipient address.

On the settings page the field "Contact form status" says whether the form is shown and why not. The strict mode and the telling apart of the client addresses are set by the platform; the app does not change them.

The reCAPTCHA key fields and the Contact form status field saying the form is available

The recipient address

The address comes from the "Contact e-mail" field of the Website Kit settings and is copied to Contact Us Settings while that field is empty or still holds the address the app wrote earlier. It must be one address, without a list and without a display name. Whenever the app changes the recipient address or switches the contact page on or off, it also switches off the acknowledgement mail to the visitor if that was on. The app enables the contact page only while the form is usable, and disables it again when that stops being true.

reCAPTCHA keys

The app picks the keys in this order:

  1. Your own keys. Enter a site key and a secret key in the settings (both or neither); the secret key is stored encrypted and never shown. You register your own domain with Google. Tokens are accepted from the address the request came to.
  2. Platform keys, when the spam protection already knows this address.
  3. The shared erp-crm.org keys: while you have entered none, on an address that ends in .erp-crm.org and equals the site name. A custom domain of the site does not get these keys, because a token made on another address would be refused; there the page shows the e-mail and phone until you enter your own keys.

This order describes how the app decides, not what a given site has. Website Kit is an optional app (release 0.3.3): a site has it only if its owner installed it (from the "Apps" tab of the site or the app catalog), and the keys above exist only for such a site.

The keys are handed to the spam protection only for the one request that posts the form; they are not stored anywhere else or written to a log.

The Privacy page

The page names the responsible person only after you fill in "Data controller name". The paragraph about Google reCAPTCHA is on the page only while the form is shown. The legal text is yours.

When the form is missing

Read "Contact form status" on the settings page. Typical reasons: the spam protection is missing on the site; its strict mode is not on for the contact form; there are no keys for this address; there is no recipient address, or there are several.

More in the documentation and the articles: Website Kit: first steps, How to install Website Kit and choose a theme.

© FOSS-ON-LINE LLC, EDRPOU 30291001. Office: 20 Darwin Street, building 3, 3rd floor, Kharkiv 61002, Ukraine. All rights reserved.