• I have a form that uses the on_sent_ok to redirect someone to another page after a submission.

    I am trying to add a function in my functions.php file that does some stuff before the email is sent out using the hook ‘wpcf7_before_send_mail’.

    Inside the function I’m simply echoing one of the post variables.

    It seems as though my function is never being called but the email is getting sent regardless. The ‘on_sent_ok’ is also never firing. If I remove the action the ‘on_sent_ok’ fires just fine.

    Is this a bug or a feature? I’m pretty sure it has something to do with the form using AJAX to submit.

    Any help would be appreciated. Thanks.

    https://www.ads-software.com/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
  • I have seen this in some older posts:

    Contact Form 7 loads the Javascript responsible for the redirect in the footer. If your theme doesn’t include the <?php wp_footer(); ?> line, the Javascript will never load…and the redirect won’t work.

Viewing 1 replies (of 1 total)
  • The topic ‘Bug on wpcf7_before_send_mail and on_sent_ok’ is closed to new replies.