PluginProbe
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification / 5.6.3
Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification v5.6.3
5.6.2 5.6.3 5.6.1 5.6.0 5.5.0 5.4.0 5.3.2 5.3.1 5.1.6 5.1.5 trunk 2.1.5 2.11 2.12 2.13 2.15 3.0.0 3.0.1 3.0.2 3.0.3 3.0.5 3.0.51 3.0.60 3.0.61 3.0.62 All 38 releases
← All changes | src/Integration/CF7Integration.php +7 -1 5.6.0 → 5.6.3 View file →
@@ -12,8 +12,9 @@
12 12 use Forge12\DoubleOptIn\EmailTemplates\PlaceholderMapper;
13 13 use Forge12\DoubleOptIn\FollowUp\FollowUpAttempt;
14 14 use Forge12\DoubleOptIn\FollowUp\FollowUpCoordinator;
15 15 use Forge12\DoubleOptIn\FollowUp\FollowUpResult;
16 +use Forge12\DoubleOptIn\Frontend\ErrorNotification;
16 17 use forge12\contactform7\CF7DoubleOptIn\Category;
17 18 use forge12\contactform7\CF7DoubleOptIn\CF7DoubleOptIn;
18 19 use forge12\contactform7\CF7DoubleOptIn\HTMLSelect;
19 20 use forge12\contactform7\CF7DoubleOptIn\OptIn;
@@ -286,14 +287,19 @@
286 287 // Always prevent the original CF7 mail from being sent when opt-in creation fails
287 288 add_filter( 'wpcf7_skip_mail', '__return_true' );
288 289
289 290 $error = self::getLastError();
290 - if ( $error && apply_filters( 'f12_cf7_doubleoptin_show_validation_error', false ) ) {
291 + // Abort with the reason instead of CF7's "sent": CF7 then keeps the
292 + // visitor's input and shows the message in the form. A refused
293 + // consent always takes this path (OptInError::isAlwaysShown()).
294 + if ( $error && $error->shouldShowToVisitor( (int) $formId ) ) {
291 295 $message = apply_filters( 'f12_cf7_doubleoptin_error_message', $error->getMessage(), $error, $formId );
292 296 if ( method_exists( $submission, 'set_response' ) ) {
293 297 $submission->set_response( $message );
294 298 }
295 299 $abort = true;
300 + // The form shows it now — no second copy in the toast.
301 + ErrorNotification::forget();
296 302 }
297 303 return;
298 304 }
299 305