• Resolved dedrago

    (@dedrago)


    Hi, I tried to use

    // define the wpcf7_mail_sent callback 
    function action_wpcf7_mail_sent( $contact_form ) { 
        echo "<script type='text/javascript'>alert('lalala');</script>";
    }; 
             
    // add the action 
    add_action( 'wpcf7_mail_sent', 'action_wpcf7_mail_sent', 10, 1 ); 

    But it doesn’t work. I need to fire PHP code after submission. Thank you!

    • This topic was modified 7 years, 1 month ago by dedrago.
Viewing 1 replies (of 1 total)
  • Thread Starter dedrago

    (@dedrago)

    If you need to test the function, better to use error_log.
    E.g.

    function cf7_success_page_form_submitted( $contact_form ) {
    error_log("test");
    }
    add_action( 'wpcf7_mail_sent', 'cf7_success_page_form_submitted' );
Viewing 1 replies (of 1 total)
  • The topic ‘wpcf7_mail_sent doesn’t work’ is closed to new replies.