• Resolved anphira

    (@anphira)


    I’m looking to try to catch failed for submissions to be able to monitor a lot (100+) of websites for errors.

    So it looks like this plugin works fine for submits, but I want it to fire for things like “wpcf7invalid”, “wpcf7spam”, “wpcf7mailfailed”.

    I’m basically trying to tie failure conditions to a zapier which would populate a google spreadsheet and then I could see and filter things.

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

    (@mariovalney)

    Hi! I’m sorry for taking so long to answer.

    Yes! If you check cf7-to-zapier/modules/cf7/class-module-cf7.php file (line 204), you will be able to see we trigger this:

    do_action( 'ctz_trigger_webhook', $data, $properties['hook_url'] );

    This way you can send data to a URL using wpcf7_mail_failed action.

    In cf7-to-zapier/modules/zapier/class-module-zapier.php you can see:

    * $data should be a array (we convert it to json); and,
    * the second paramter should be the hook URL.

    So add to your functions.php:

    <?php
    add_action( 'wpcf7_mail_failed', 'anphira_wpcf7_mail_failed' );
    
    function anphira_wpcf7_mail_failed( $contact_form ) {
        $properties = $contact_form->prop( 'ctz_zapier' );
    
        // TODO: populate $data
        $data = [];
    
        do_action( 'ctz_trigger_webhook', $data, $properties['hook_url'] );
    }

    I hope this can help you.

    • This reply was modified 5 years, 9 months ago by Mário Valney.
Viewing 1 replies (of 1 total)
  • The topic ‘Possible to use with failed forms?’ is closed to new replies.