PluginProbe
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress / 11.1.0
AcyMailing – An Ultimate Newsletter Plugin and Marketing Automation Solution for WordPress v11.1.0
11.1.1 11.1.0 11.0.5 11.0.4 11.0.3 11.0.2 11.0.1 11.0.0 10.11.1 10.11.0 10.10.2 10.10.1 10.10.0 10.9.1 trunk 10.0.0 10.0.1 10.1.0 10.1.1 10.1.2 10.1.3 10.1.4 10.2.0 10.2.1 10.2.2 All 62 releases
← All changes | WpInit/OverrideEmail.php +12 -1 10.11.1 → 11.1.0 View file →
@@ -12,8 +12,18 @@
12 12 }
13 13
14 14 public function overrideEmailFunction($args)
15 15 {
16 + // A previous email in the same request may have registered the "blockEmailSending" and "blockEmailSendingPostSMTP" hooks below.
17 + // We remove them systematically so each email is evaluated independently and we never missblock an email
18 + remove_action('phpmailer_init', [$this, 'blockEmailSending']);
19 + remove_filter('post_smtp_do_send_email', [$this, 'blockEmailSendingPostSMTP']);
20 +
21 + // Let integrators exclude specific emails from AcyMailing's handling
22 + if (!apply_filters('acym_override_wp_mail', true, $args)) {
23 + return $args;
24 + }
25 +
16 26 if (empty($args['to'])) {
17 27 return $args;
18 28 }
19 29
@@ -52,8 +62,9 @@
52 62 $contentType = trim($type);
53 63 if (stripos($charsetContent, 'boundary=') !== false) {
54 64 $boundary = trim(str_replace(['BOUNDARY=', 'boundary=', '"'], '', $charsetContent));
55 65 }
66 + // Avoid setting an empty $content_type.
56 67 } elseif (trim($content) !== '') {
57 68 $contentType = trim($content);
58 69 }
59 70 } else {
@@ -104,9 +115,9 @@
104 115 }
105 116
106 117 public function blockEmailSending(&$phpmailer)
107 118 {
108 - $phpmailer = new FakePhpMailer();
119 + $phpmailer = new MailDisabler();
109 120 }
110 121
111 122 public function blockEmailSendingPostSMTP($shouldSend)
112 123 {