• Hi,

    What is the recommended way to run a custom code after the form is submitted and email is sent.

    Can someone please guide me to the documentation on the subject.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You can use the custom DOM event wpcf7mailsent, doumentation is here: https://contactform7.com/dom-events/

    A popular example being opening a new page after submitting using JavaScript:

    <script>
    document.addEventListener( 'wpcf7mailsent', function( event ) {
        location = 'http://yourredirectpage.com/';
    }, false );
    </script> 
    Thread Starter Sanjay

    (@rsclmumbai)

    Its a PHP code which has to be executed server side and in the background.
    Any PHP (server side) solution?

    I found a hook for BEFORE SEND EMAIL, but could not find one for AFTER SEND EMAIL.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Execute code after sending email’ is closed to new replies.