Skip to content

Commit

Permalink
Update wpcf7-email-verification.php
Browse files Browse the repository at this point in the history
This modification solves the problem with the duplicate mail commented in the WP support forum: https://wordpress.org/support/topic/duplicate-emails-5
It's just an adaptation to the wpcf7 plugin updates.
  • Loading branch information
mafsdisseny committed Jun 28, 2015
1 parent 3b9baf8 commit 5838eec
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wpcf7-email-verification.php
Expand Up @@ -36,11 +36,11 @@
* Intercept Contact Form 7 forms being sent by first verifying the senders email address.
*/

function wpcf7ev_skip_sending($components) {
function wpcf7ev_skip_sending($f) {

$submission = WPCF7_Submission::get_instance();
return true; //Set $skip_mail to true

$components['send'] = false;

return $components;
}

// prettify the email addresses being sent
Expand All @@ -60,7 +60,7 @@ function wpcf7ev_skip_sending($components) {
function wpcf7ev_verify_email_address( $wpcf7_form )
{
// first prevent the emails being sent as per usual
add_filter('wpcf7_mail_components', 'wpcf7ev_skip_sending');
add_filter('wpcf7_skip_mail', 'wpcf7ev_skip_sending');

// fetch the submitted form details
$mail_tags = $wpcf7_form->prop('mail');
Expand Down Expand Up @@ -104,7 +104,7 @@ function wpcf7ev_verify_email_address( $wpcf7_form )
function wpcf7ev_cleanup() {
// remove the action that triggers this plugin's code
remove_action( 'wpcf7_before_send_mail', 'wpcf7ev_verify_email_address' );
remove_filter( 'wpcf7_mail_components', 'wpcf7ev_skip_sending' ); // allow mail to be sent as per usual
remove_filter( 'wpcf7_skip_mail', 'wpcf7ev_skip_sending' ); // allow mail to be sent as per usual
}

/**
Expand Down Expand Up @@ -204,4 +204,4 @@ function wpcf7ev_cleanup_attachments() {
}
}

?>
?>

0 comments on commit 5838eec

Please sign in to comment.