aradianoff / recaptchacontact

reCaptcha Contact Plugin for Grav CMS (getgrav.org)
MIT License
8 stars 11 forks source link

Form not sending #35

Open BrownieBits opened 7 years ago

BrownieBits commented 7 years ago

I have installed the module through the admin console. When i submit the form it doesnt check the reCaptcha form or send an email. The email to and email from fields are filled out. Is there something I am missing?

bassplayer7 commented 7 years ago

Have you set up the Recaptcha keys? You would check by going here: Plugins -> reCAPTCHA Contact. At the bottom of the page, there are two fields: reCAPTCHA Sitekey and reCAPTCHA Secret key. Are they filled in? If they aren't, getting them is reasonably easy. Go to this site: https://www.google.com/recaptcha/intro/ and setup your domain.

Let me know what you find.

And sorry it took me this long to get back with you!

BrownieBits commented 7 years ago

Hey i did get all that setup... ive got the stock files with no style changes as well.

http://digitalconstruction.com/crane

bassplayer7 commented 7 years ago

Very good! Do you, by some chance, have the Grav Email Plugin installed and configured? By default, this plugin uses php mail() method. That method can be difficult to debug because it produces little information such as exceptions - it simply returns a boolean. However, if the Grav Email Plugin is enabled, it will use that.

Also, when you submit the form, do you get a success or failure message?

So here are a couple things to try:

BrownieBits commented 7 years ago

Hey the Email plugin is installed and configured to use SMTP with gmail. When i submit, it just refreshes the page. No failure or Success messages. Grav is installed in a subfolder. could that be throwing things off?

bassplayer7 commented 7 years ago

I don't think that the subfolder would matter. And the form should be sending through the SMTP account. That said, do you have the security on your gmail account turned nearly off? There's a setting that you have to allow "less secure applications" or something. I have had trouble sending through Gmail because they have tightened security a lot.

Are you getting any errors in the browser console or server log?

BrownieBits commented 7 years ago

Less secure apps are allowed and no errors in console.

wolffgruppe commented 7 years ago

Hello,

Same problem here. The "submit" button links to my Homepage this is also the case on the site PrimalIan posted. I guess it is something broken there. I have also a modular page. (does this matter?)

bassplayer7 commented 7 years ago

@PrimalIan, could you try enabling the default theme on your site? I attempted to submit the form, and it seems that the theme might be getting in the way somewhat. Also, what plugins do you have enabled?

@wolffgruppe, it should work great on a modular pages.

The next thing I'd be interested in is a reduced test case from you. It's hard to replicate this, since I can't locally or on the main site I manage. Would it be possible to put together a site (perhaps under a subdomain), that is as vanilla as possible where we could test this?

BrownieBits commented 7 years ago

The only way i can get the form to show up on my theme and the Antimatter theme is to put the include statement in a partial like the footer. the inject automatically doesnt seem to work. im not sure if its looking for some certain block to inject it into. I do notice on my theme that if i switch the home page template from Home to Default i get an extra tab that says contact form. Even then i get nothing.

BrownieBits commented 7 years ago

x-corporation.zip Here is the theme im using... its from the theme store but slightly motified...

wolffgruppe commented 7 years ago

Also, what plugins do you have enabled?

 Admin Panel  v1.2.12  Email  v2.5.3  Error  v1.6.0  Form  v2.1.0  Login  v2.2.1  Markdown Notices  v1.0.0  Problems  v1.4.5  reCAPTCHA Contact v2.1.0

This is the pluginlist for my page. The Theme is from the getgrav page. https://getgrav.org/download/themes/machine/2.0.6

Would it be possible to put together a site (perhaps under a subdomain), that is as vanilla as possible where we could test this?

I try to make a small onepager only with the form on it asap.

One question: in the Installation instruction it is written 4.Choose a page to put the form on and select the "Contact Form" tab.

What I did is adding "recaptchacontact: true" the 2nd stepp is unclear to me - can you please explain it more detailed? I do not see a tab :(

wolffgruppe commented 7 years ago

UPDATE: I failed with antimattertheme. -> conclusion I am stupid and i didn't get the setup 100% correct.

But i got partial sucsess. I got the form working (with Error 404) but hiting "back button" I see a "OK" from the form an the mail was in my inbox.

Browser shows .../home#contact-form

I tried several things so I can not say what did the trick - I can invest on Monday. But from what I get the Problem seems to bee the "action" of the submit button. (I messed around whith standard forms and this Option form: action: /home )

iggbodiam commented 7 years ago

Hello I just ran into the same issue, onSubmit I get the following. It's clear the plugin doesn't work out-of-the-box, I hope I fix this (newbie here)


                    /** @var Pages $pages */
                    $pages = $this->grav['pages'];
                    $page = $pages->dispatch($route, true);

                    if (!$page) {
                        throw new \RuntimeException('Display page not found. Please check the page exists.', 400);
                    }

                    unset($this->grav['page']);
                    $this->grav['page'] = $page;
                    break;
                case 'save':
                    $prefix = !empty($params['fileprefix']) ? $params['fileprefix'] : '';
                    $format = !empty($params['dateformat']) ? $params['dateformat'] : 'Ymd-His-u';
                    $ext = !empty($params['extension']) ? '.' . trim($params['extension'], '.') : '.txt';
                    $filename = !empty($params['filename']) ? $params['filename'] : '';
                    $operation = !empty($params['operation']) ? $params['operation'] : 'create';

                    if (!$filename) {
                        $filename = $prefix . $this->udate($format) . $ext;
                    }

                    /** @var Twig $twig */
                    $twig = $this->grav['twig'];
                    $vars = [
                        'form' => $form

Arguments

    "Display page not found. Please check the page exists."