• Resolved jlubeck

    (@jlubeck)


    Hi, hopefully I can get some help here.

    I have a working CF7 form setup. My forms are working and I’m getting emails correctly.
    But as soon as I enable the integration by marking “Send to Webhook” and try to send a new form, I get the error “There was an error trying to send your message. Please try again later.”

    As soon as I disable it, form starts working again.

    Any idea how I can troubleshoot this?

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Mário Valney

    (@mariovalney)

    Hi.

    Maybe it’s a problem sending the webhook POST as we use the default error message.

    Would you could activate the WP_DEBUG?
    https://www.ads-software.com/support/article/debugging-in-wordpress/#example-wp-config-php-for-debugging

    By now we don’t print any error log. I’ll add it later, but let’s check something is written by wp_remote_post function.

    If not, we can try change the plpugin file to print the exception if you are OK with that.

    This file:
    cf7-to-zapier/modules/cf7/class-module-cf7.php

    This log:

    $error_message =  apply_filters( 'ctz_trigger_webhook_error_message', $contact_form->message( 'mail_sent_ng' ), $exception );
    error_log( $e->getMessage() ); // <------- Add this
    
    // If empty ignore
    if ( empty( $error_message ) ) return;
    

    (By the way… I recommend check on development / staging site)

    Thread Starter jlubeck

    (@jlubeck)

    Thanks for the quick reply!

    I activated the WP_DEBUG but doesn’t seem to be showing anything extra… unless there is some sort of caching enabled on my site.

    What should I change on that file to print the exception?

    Thread Starter jlubeck

    (@jlubeck)

    Ok, sorry about that. I didn’t notice you actually included what I needed to change. I did that and here is the error in the logs:

    [28-Jul-2020 18:03:12 UTC] PHP Notice:  Undefined variable: e in /var/www/wp-content/plugins/cf7-to-zapier/modules/cf7/class-module-cf7.php on line 240
    [28-Jul-2020 18:03:12 UTC] PHP Fatal error:  Uncaught Error: Call to a member function getMessage() on null in /var/www/wp-content/plugins/cf7-to-zapier/modules/cf7/class-module-cf7.php:240
    Stack trace:
    #0 /var/www/wp-includes/class-wp-hook.php(287): CFTZ_Module_CF7->wpcf7_mail_sent(Object(WPCF7_ContactForm))
    #1 /var/www/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #2 /var/www/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /var/www/wp-content/plugins/contact-form-7/includes/submission.php(89): do_action('wpcf7_mail_sent', Object(WPCF7_ContactForm))
    #4 /var/www/wp-content/plugins/contact-form-7/includes/submission.php(24): WPCF7_Submission->proceed()
    #5 /var/www/wp-content/plugins/contact-form-7/includes/contact-form.php(727): WPCF7_Submission::get_instance(Object(WPCF7_ContactForm), Array)
    #6 /var/www/wp-content/plugins/contact-form-7/includes/rest-api.php(298): WPCF7_ContactForm->submit()
    #7 /var/www/wp-includes/rest-api/class-wp-rest-server.php(1015): wpcf7_rest_create_feedback(Object(WP_REST_Request))
    #8 /var/www/w in /var/www/wp-content/plugins/cf7-to-zapier/modules/cf7/class-module-cf7.php on line 240
    
    Thread Starter jlubeck

    (@jlubeck)

    Ok, sorry about that again. I copy/pasted your snippet as it was, and there was an error in it. $e->getMessage(); should have been $exception->getMessage();

    Now I see the error is

    [28-Jul-2020 18:09:37 UTC] cURL error 7: Failed to connect to osx.scan4beer.com port 3000: Connection refused

    But if I try the webhook on other places it works just fine, so I don’t think I’m preventing anything on the server side…

    I’ll try to contact my hosting provider… do you have any other ideas on your side?

    Plugin Author Mário Valney

    (@mariovalney)

    Hi!

    Would you mind to try using a webhook from: https://webhook.site ?
    We can check is a problem with server or with the webhook.

    Thread Starter jlubeck

    (@jlubeck)

    Thank you for the follow up… it was freaking GoDaddy. They disallow curl on any port other than 80/443 on shared plans…

    Plug in is working fine. But thank you for helping me figure it out

    Plugin Author Mário Valney

    (@mariovalney)

    Oh. That’s sad…
    Good luck ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘There was an error trying to send your message. Please try again later.’ is closed to new replies.