Creating custom messages
-
I’m intercepting the email being sent using
$abort = true;
I want to display a custom message for that abort message.The related code looks like this…
add_action('wpcf7_before_send_mail', 'wpcf7ev_verify_email_address', 10, 2); add_filter('wpcf7_display_message', function ($message, $status) { $submission = WPCF7_Submission::get_instance(); if ($submission->is('abort')) { $message = __('Please check your email to verify your email address.', ''); } return $message; } , 10, 2); function wpcf7ev_verify_email_address($wpcf7_form, &$abort) { // first prevent the emails being sent as per usual $abort = true;
The email does get aborted, but the message is still ‘Sending mail has been aborted.’. I’m not sure if that filter is being called?
What am I doing wrong with the
wpcf7_display_message
filter?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Creating custom messages’ is closed to new replies.