getgrav / grav-plugin-email

Grav Email Plugin
http://getgrav.org
MIT License
37 stars 29 forks source link

g-recaptcha is not processed when sending email with form page #25

Closed JohnMica closed 8 years ago

JohnMica commented 8 years ago

Hi guys,

It seems that the g-recaptcha is not picked up when send is pressed. I keep getting validation error - recaptcha field not field in.

captura de ecran din 2016 05 11 la 21 20 23

unless I am doing something strange :) I seem to be the one that gets interesting issues with no replication ...

JohnMica commented 8 years ago

I have tested without recaptcha and with just now using the mailtrap.io .

without it is processed, with recaptcha is not processed. the error is that it cannot read the recaptcha field and thus "validation has failed" error.

flaviocopes commented 8 years ago

Can you paste your form definition?

JohnMica commented 8 years ago

Hi Flavio, the file is as it follows:

---
title: Contact
body_classes: 'header-image fullwidth'
process:
    twig: true
form:
    name: Formular-Contact
    fields:
        -
            name: name
            label: Numele
            placeholder: 'Numele Dvs.'
            autofocus: 'on'
            autocomplete: 'on'
            type: text
            validate:
                required: true
        -
            name: email
            label: 'Adresa de Email'
            placeholder: 'Introduce-ți adresa de email'
            autofocus: 'off'
            autocomplete: 'on'
            type: email
            validate:
                rule: email
                required: true
        -
            name: message
            label: 'Mesajul Dvs.'
            size: large
            placeholder: 'Aici scrieți mesajul'
            type: textarea
            validate:
                required: true
        -
            name: g-recaptcha-response
            label: 'Nu sunt robot'
            type: captcha
            recatpcha_site_key: my public key
            recaptcha_not_validated: 'Captcha not valid!'
            validate:
                required: true
    buttons:
        -
            type: submit
            value: Trimite
        -
            type: reset
            value: Anulează
    process:
        -
            captcha:
                recatpcha_secret: my secret key
        -
            email:
                from: '{{ config.plugins.email.from }}'
                to: ['{{ config.plugins.email.from }}', '{{ form.value.email }}']
                subject: '[Feedback] {{ form.value.name|e }}'
                body: '{% include ''forms/data.html.twig'' %}'
        -
            save:
                fileprefix: feedback-
                dateformat: Ymd-His-u
                extension: txt
                body: '{% include ''forms/data.txt.twig'' %}'
        -
            message: 'Multumim pentru mesaj'
        -
            display: multumim
---

### Contactați-ne

Puteți să ne trimiteți un email direct la adresa noastră <a href="mailto:{{'echipa@canabismedical.ro'|safe_email}}">
  de email
</a>

sau prin completarea formularului de mai jos:

i knkow the spelling is wrong on recaptcha (but as you pointed out previouslty a few months ago the misspelled is still valid)

flaviocopes commented 8 years ago

Sorry for the delay, I tried the form, but it's validating correctly for me.

JohnMica commented 8 years ago

It's validating now for me too @flaviocopes. Thanks for trying.
I'll close this one now