Hello,
I’m creating a contact form using the documentation.
However, the captcha isn’t working (not showing).
The console outputs this error:
Error: Missing required parameters in RecaptchaOptions: sitekey
However, my recaptcha_site_key
is defined.
Without the captcha, the form works perfectly fine.
Here’s the full (edited) contact page’s frontmatter:
title: ‘Nous contacter’
visible: true
in_nav: true
coord: “Company address”
form:
action: /contact
name: contact
fields:
-
name: name
label: ‘Votre nom complet’
placeholder: ‘Nom complet’
type: text
autofocus: ‘on’
validate:
required: true
-
name: company
label: ‘Votre société’
placeholder: Société
type: text
-
name: email
label: ‘Votre adresse e-mail’
placeholder: E-mail
type: email
validate:
rule: email
required: true
-
name: phone
label: ‘Votre numéro de téléphone’
placeholder: Téléphone
type: text
-
name: message
label: ‘Votre message’
placeholder: Message
type: textarea
validate:
required: true
-
name: g-recaptcha-response
label: Validation
type: captcha
recaptcha_site_key: I-WROTE-THE-KEY-HERE
recaptcha_not_validated: ‘Validation incorrecte.’
validate:
required: true
buttons:
-
type: submit
value: Envoyer
process:
-
captcha:
recaptcha_secret: I-WROTE-THE-OTHER-KEY-HERE
-
email:
from: ‘{{ form.value.email }}’
from_name: ‘{{ form.value.name|e }}’
to: ‘{{ config.plugins.email.to }}’
subject: ‘[Site] Message de {{ form.value.name|e }},{% if form.value.company %} ({{form.value.company|e }}){% endif %}’
body: ‘{% include ‘‘forms/data.html.twig’’ %}’
-
save:
fileprefix: contact-
dateformat: Ymd-His-u
extension: txt
body: ‘{% include ‘‘forms/data.txt.twig’’ %}’
-
message: hop!
-
display: ok
Can someone see what’s wrong?
Thanks!