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 +14 -1 10.0.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 {
@@ -80,8 +91,10 @@
80 91 }
81 92 }
82 93
83 94 $mailerHelper = new MailerHelper();
95 + $mailerHelper->report = false;
96 +
84 97 $success = $mailerHelper->overrideEmail(
85 98 [
86 99 'subject' => $args['subject'],
87 100 'message' => $args['message'],
@@ -102,9 +115,9 @@
102 115 }
103 116
104 117 public function blockEmailSending(&$phpmailer)
105 118 {
106 - $phpmailer = new FakePhpMailer();
119 + $phpmailer = new MailDisabler();
107 120 }
108 121
109 122 public function blockEmailSendingPostSMTP($shouldSend)
110 123 {