MailPoet Newsletters (New) - Version 3.32.1

Version Description

  • 2019-07-11 =
  • Improved: minor changes and fixes.
Download this release

Release Info

Developer wysija
Plugin Icon 128x128 MailPoet Newsletters (New)
Version 3.32.1
Comparing to
See all releases

Code changes from version 3.32.0 to 3.32.1

Files changed (44) hide show
  1. lang/mailpoet-ar.mo +0 -0
  2. lang/mailpoet-ca.mo +0 -0
  3. lang/mailpoet-cs_CZ.mo +0 -0
  4. lang/mailpoet-da_DK.mo +0 -0
  5. lang/mailpoet-de_DE.mo +0 -0
  6. lang/mailpoet-el.mo +0 -0
  7. lang/mailpoet-es_ES.mo +0 -0
  8. lang/mailpoet-es_MX.mo +0 -0
  9. lang/mailpoet-fr_CA.mo +0 -0
  10. lang/mailpoet-fr_FR.mo +0 -0
  11. lang/mailpoet-hu_HU.mo +0 -0
  12. lang/mailpoet-it_IT.mo +0 -0
  13. lang/mailpoet-ja.mo +0 -0
  14. lang/mailpoet-nb_NO.mo +0 -0
  15. lang/mailpoet-nl_NL.mo +0 -0
  16. lang/mailpoet-pt_BR.mo +0 -0
  17. lang/mailpoet-pt_PT.mo +0 -0
  18. lang/mailpoet-ro_RO.mo +0 -0
  19. lang/mailpoet-ru_RU.mo +0 -0
  20. lang/mailpoet-sq.mo +0 -0
  21. lang/mailpoet-sr_RS.mo +0 -0
  22. lang/mailpoet-sv_SE.mo +0 -0
  23. lang/mailpoet-tr_TR.mo +0 -0
  24. lang/mailpoet-zh_CN.mo +0 -0
  25. lang/mailpoet.pot +19 -18
  26. lib/Mailer/Methods/AmazonSES.php +6 -0
  27. lib/Mailer/Methods/BlacklistTrait.php +29 -0
  28. lib/Mailer/Methods/ErrorMappers/AmazonSESMapper.php +3 -0
  29. lib/Mailer/Methods/ErrorMappers/BlacklistErrorMapperTrait.php +14 -0
  30. lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php +4 -0
  31. lib/Mailer/Methods/ErrorMappers/PHPMailMapper.php +3 -0
  32. lib/Mailer/Methods/ErrorMappers/SMTPMapper.php +3 -0
  33. lib/Mailer/Methods/ErrorMappers/SendGridMapper.php +3 -0
  34. lib/Mailer/Methods/MailPoet.php +10 -0
  35. lib/Mailer/Methods/PHPMail.php +6 -0
  36. lib/Mailer/Methods/SMTP.php +6 -0
  37. lib/Mailer/Methods/SendGrid.php +6 -0
  38. lib/Subscription/Blacklist.php +25 -0
  39. mailpoet.php +2 -2
  40. readme.txt +4 -1
  41. vendor-prefixed/autoload.php +1 -1
  42. vendor/autoload.php +1 -1
  43. vendor/composer/autoload_real.php +7 -7
  44. vendor/composer/autoload_static.php +5 -5
lang/mailpoet-ar.mo CHANGED
Binary file
lang/mailpoet-ca.mo CHANGED
Binary file
lang/mailpoet-cs_CZ.mo CHANGED
Binary file
lang/mailpoet-da_DK.mo CHANGED
Binary file
lang/mailpoet-de_DE.mo CHANGED
Binary file
lang/mailpoet-el.mo CHANGED
Binary file
lang/mailpoet-es_ES.mo CHANGED
Binary file
lang/mailpoet-es_MX.mo CHANGED
Binary file
lang/mailpoet-fr_CA.mo CHANGED
Binary file
lang/mailpoet-fr_FR.mo CHANGED
Binary file
lang/mailpoet-hu_HU.mo CHANGED
Binary file
lang/mailpoet-it_IT.mo CHANGED
Binary file
lang/mailpoet-ja.mo CHANGED
Binary file
lang/mailpoet-nb_NO.mo CHANGED
Binary file
lang/mailpoet-nl_NL.mo CHANGED
Binary file
lang/mailpoet-pt_BR.mo CHANGED
Binary file
lang/mailpoet-pt_PT.mo CHANGED
Binary file
lang/mailpoet-ro_RO.mo CHANGED
Binary file
lang/mailpoet-ru_RU.mo CHANGED
Binary file
lang/mailpoet-sq.mo CHANGED
Binary file
lang/mailpoet-sr_RS.mo CHANGED
Binary file
lang/mailpoet-sv_SE.mo CHANGED
Binary file
lang/mailpoet-tr_TR.mo CHANGED
Binary file
lang/mailpoet-zh_CN.mo CHANGED
Binary file
lang/mailpoet.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
7
- "POT-Creation-Date: 2019-07-09 08:39:08+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -1606,72 +1606,73 @@ msgstr ""
1606
  msgid "Sending frequency limit has been reached."
1607
  msgstr ""
1608
 
1609
- #: lib/Mailer/Methods/AmazonSES.php:50
1610
  msgid "Unsupported Amazon SES region"
1611
  msgstr ""
1612
 
1613
- #: lib/Mailer/Methods/ErrorMappers/AmazonSESMapper.php:28
1614
- #: lib/Mailer/Methods/ErrorMappers/PHPMailMapper.php:23
1615
- #: lib/Mailer/Methods/ErrorMappers/SMTPMapper.php:36
1616
- #: lib/Mailer/Methods/ErrorMappers/SendGridMapper.php:15
 
1617
  msgid "%s has returned an unknown error."
1618
  msgstr ""
1619
 
1620
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:25
1621
  msgid "MailPoet API key is invalid!"
1622
  msgstr ""
1623
 
1624
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:38
1625
  msgid "JSON input is not an array"
1626
  msgstr ""
1627
 
1628
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:42
1629
  msgid "Error while sending."
1630
  msgstr ""
1631
 
1632
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:55
1633
  msgid ""
1634
  "Email service is temporarily not available, please try again in a few "
1635
  "minutes."
1636
  msgstr ""
1637
 
1638
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:78
1639
  msgid "Invalid MSS response format."
1640
  msgstr ""
1641
 
1642
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:95
1643
  msgid ""
1644
  "The MailPoet Sending Service did not send your latest email because the "
1645
  "address <i>%s</i> is not yet authorized."
1646
  msgstr ""
1647
 
1648
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:95
1649
  msgid "Unknown address"
1650
  msgstr ""
1651
 
1652
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:98
1653
  msgid "[link]Authorize your email in your account now.[/link]"
1654
  msgstr ""
1655
 
1656
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:106
1657
  #: lib/Util/Notices/UnauthorizedEmailInNewslettersNotice.php:82
1658
  #: lib/Util/Notices/UnauthorizedEmailNotice.php:103 views/newsletters.html:303
1659
  msgid "Resume sending"
1660
  msgstr ""
1661
 
1662
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:112
1663
  msgid ""
1664
  "The MailPoet Sending Service has stopped sending your emails for one of the "
1665
  "following reasons:"
1666
  msgstr ""
1667
 
1668
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:115
1669
  msgid ""
1670
  "You may have reached the subscriber limit of your plan. [link]Manage your "
1671
  "subscriptions[/link]."
1672
  msgstr ""
1673
 
1674
- #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:124
1675
  msgid ""
1676
  "You may have had a poor deliverability rate. Please [link]contact our "
1677
  "support team[/link] to resolve the issue."
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
7
+ "POT-Creation-Date: 2019-07-11 11:40:17+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
1606
  msgid "Sending frequency limit has been reached."
1607
  msgstr ""
1608
 
1609
+ #: lib/Mailer/Methods/AmazonSES.php:52
1610
  msgid "Unsupported Amazon SES region"
1611
  msgstr ""
1612
 
1613
+ #: lib/Mailer/Methods/ErrorMappers/AmazonSESMapper.php:31
1614
+ #: lib/Mailer/Methods/ErrorMappers/BlacklistErrorMapperTrait.php:10
1615
+ #: lib/Mailer/Methods/ErrorMappers/PHPMailMapper.php:26
1616
+ #: lib/Mailer/Methods/ErrorMappers/SMTPMapper.php:39
1617
+ #: lib/Mailer/Methods/ErrorMappers/SendGridMapper.php:18
1618
  msgid "%s has returned an unknown error."
1619
  msgstr ""
1620
 
1621
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:29
1622
  msgid "MailPoet API key is invalid!"
1623
  msgstr ""
1624
 
1625
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:42
1626
  msgid "JSON input is not an array"
1627
  msgstr ""
1628
 
1629
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:46
1630
  msgid "Error while sending."
1631
  msgstr ""
1632
 
1633
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:59
1634
  msgid ""
1635
  "Email service is temporarily not available, please try again in a few "
1636
  "minutes."
1637
  msgstr ""
1638
 
1639
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:82
1640
  msgid "Invalid MSS response format."
1641
  msgstr ""
1642
 
1643
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:99
1644
  msgid ""
1645
  "The MailPoet Sending Service did not send your latest email because the "
1646
  "address <i>%s</i> is not yet authorized."
1647
  msgstr ""
1648
 
1649
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:99
1650
  msgid "Unknown address"
1651
  msgstr ""
1652
 
1653
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:102
1654
  msgid "[link]Authorize your email in your account now.[/link]"
1655
  msgstr ""
1656
 
1657
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:110
1658
  #: lib/Util/Notices/UnauthorizedEmailInNewslettersNotice.php:82
1659
  #: lib/Util/Notices/UnauthorizedEmailNotice.php:103 views/newsletters.html:303
1660
  msgid "Resume sending"
1661
  msgstr ""
1662
 
1663
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:116
1664
  msgid ""
1665
  "The MailPoet Sending Service has stopped sending your emails for one of the "
1666
  "following reasons:"
1667
  msgstr ""
1668
 
1669
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:119
1670
  msgid ""
1671
  "You may have reached the subscriber limit of your plan. [link]Manage your "
1672
  "subscriptions[/link]."
1673
  msgstr ""
1674
 
1675
+ #: lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php:128
1676
  msgid ""
1677
  "You may have had a poor deliverability rate. Please [link]contact our "
1678
  "support team[/link] to resolve the issue."
lib/Mailer/Methods/AmazonSES.php CHANGED
@@ -8,6 +8,8 @@ use MailPoet\WP\Functions as WPFunctions;
8
  if (!defined('ABSPATH')) exit;
9
 
10
  class AmazonSES {
 
 
11
  public $aws_access_key;
12
  public $aws_secret_key;
13
  public $aws_region;
@@ -67,6 +69,10 @@ class AmazonSES {
67
  }
68
 
69
  function send($newsletter, $subscriber, $extra_params = []) {
 
 
 
 
70
  try {
71
  $result = $this->wp->wpRemotePost(
72
  $this->url,
8
  if (!defined('ABSPATH')) exit;
9
 
10
  class AmazonSES {
11
+ use BlacklistTrait;
12
+
13
  public $aws_access_key;
14
  public $aws_secret_key;
15
  public $aws_region;
69
  }
70
 
71
  function send($newsletter, $subscriber, $extra_params = []) {
72
+ if ($this->isBlacklisted($subscriber)) {
73
+ $error = $this->error_mapper->getBlacklistError($subscriber);
74
+ return Mailer::formatMailerErrorResult($error);
75
+ }
76
  try {
77
  $result = $this->wp->wpRemotePost(
78
  $this->url,
lib/Mailer/Methods/BlacklistTrait.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace MailPoet\Mailer\Methods;
3
+
4
+ use MailPoet\Subscription\Blacklist;
5
+
6
+ trait BlacklistTrait {
7
+ /** @var Blacklist */
8
+ private $blacklist;
9
+
10
+ function isBlacklisted($subscriber) {
11
+ $email = $this->getSubscriberEmailForBlacklistCheck($subscriber);
12
+ return $this->getBlacklist()->isBlacklisted($email);
13
+ }
14
+
15
+ private function getSubscriberEmailForBlacklistCheck($subscriber_string) {
16
+ preg_match('!(?P<name>.*?)\s<(?P<email>.*?)>!', $subscriber_string, $subscriber_data);
17
+ if (!isset($subscriber_data['email'])) {
18
+ return $subscriber_string;
19
+ }
20
+ return $subscriber_data['email'];
21
+ }
22
+
23
+ private function getBlacklist() {
24
+ if (!$this->blacklist instanceof Blacklist) {
25
+ $this->blacklist = new Blacklist();
26
+ }
27
+ return $this->blacklist;
28
+ }
29
+ }
lib/Mailer/Methods/ErrorMappers/AmazonSESMapper.php CHANGED
@@ -7,8 +7,11 @@ use MailPoet\Mailer\SubscriberError;
7
  use MailPoet\WP\Functions as WPFunctions;
8
 
9
  class AmazonSESMapper {
 
10
  use ConnectionErrorMapperTrait;
11
 
 
 
12
  function getErrorFromException(\Exception $e, $subscriber) {
13
  $level = MailerError::LEVEL_HARD;
14
  if ($e instanceof \Swift_RfcComplianceException) {
7
  use MailPoet\WP\Functions as WPFunctions;
8
 
9
  class AmazonSESMapper {
10
+ use BlacklistErrorMapperTrait;
11
  use ConnectionErrorMapperTrait;
12
 
13
+ const METHOD = Mailer::METHOD_AMAZONSES;
14
+
15
  function getErrorFromException(\Exception $e, $subscriber) {
16
  $level = MailerError::LEVEL_HARD;
17
  if ($e instanceof \Swift_RfcComplianceException) {
lib/Mailer/Methods/ErrorMappers/BlacklistErrorMapperTrait.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace MailPoet\Mailer\Methods\ErrorMappers;
3
+
4
+ use MailPoet\Mailer\MailerError;
5
+ use MailPoet\Mailer\SubscriberError;
6
+ use MailPoet\WP\Functions as WPFunctions;
7
+
8
+ trait BlacklistErrorMapperTrait {
9
+ function getBlacklistError($subscriber) {
10
+ $message = sprintf(WPFunctions::get()->__('%s has returned an unknown error.', 'mailpoet'), self::METHOD);
11
+ $subscriber_errors = [new SubscriberError($subscriber, null)];
12
+ return new MailerError(MailerError::OPERATION_SEND, MailerError::LEVEL_SOFT, $message, null, $subscriber_errors);
13
+ }
14
+ }
lib/Mailer/Methods/ErrorMappers/MailPoetMapper.php CHANGED
@@ -2,6 +2,7 @@
2
  namespace MailPoet\Mailer\Methods\ErrorMappers;
3
 
4
  use MailPoet\Mailer\MailerError;
 
5
  use MailPoet\Mailer\SubscriberError;
6
  use MailPoet\Services\Bridge\API;
7
  use InvalidArgumentException;
@@ -14,8 +15,11 @@ if (!defined('ABSPATH')) exit;
14
 
15
 
16
  class MailPoetMapper {
 
17
  use ConnectionErrorMapperTrait;
18
 
 
 
19
  const TEMPORARY_UNAVAILABLE_RETRY_INTERVAL = 300; // seconds
20
 
21
  function getInvalidApiKeyError() {
2
  namespace MailPoet\Mailer\Methods\ErrorMappers;
3
 
4
  use MailPoet\Mailer\MailerError;
5
+ use MailPoet\Mailer\Mailer;
6
  use MailPoet\Mailer\SubscriberError;
7
  use MailPoet\Services\Bridge\API;
8
  use InvalidArgumentException;
15
 
16
 
17
  class MailPoetMapper {
18
+ use BlacklistErrorMapperTrait;
19
  use ConnectionErrorMapperTrait;
20
 
21
+ const METHOD = Mailer::METHOD_MAILPOET;
22
+
23
  const TEMPORARY_UNAVAILABLE_RETRY_INTERVAL = 300; // seconds
24
 
25
  function getInvalidApiKeyError() {
lib/Mailer/Methods/ErrorMappers/PHPMailMapper.php CHANGED
@@ -7,8 +7,11 @@ use MailPoet\Mailer\SubscriberError;
7
  use MailPoet\WP\Functions as WPFunctions;
8
 
9
  class PHPMailMapper {
 
10
  use ConnectionErrorMapperTrait;
11
 
 
 
12
  function getErrorFromException(\Exception $e, $subscriber) {
13
  $level = MailerError::LEVEL_HARD;
14
  if (strpos($e->getMessage(), 'Invalid address') === 0) {
7
  use MailPoet\WP\Functions as WPFunctions;
8
 
9
  class PHPMailMapper {
10
+ use BlacklistErrorMapperTrait;
11
  use ConnectionErrorMapperTrait;
12
 
13
+ const METHOD = Mailer::METHOD_PHPMAIL;
14
+
15
  function getErrorFromException(\Exception $e, $subscriber) {
16
  $level = MailerError::LEVEL_HARD;
17
  if (strpos($e->getMessage(), 'Invalid address') === 0) {
lib/Mailer/Methods/ErrorMappers/SMTPMapper.php CHANGED
@@ -7,8 +7,11 @@ use MailPoet\Mailer\SubscriberError;
7
  use MailPoet\WP\Functions as WPFunctions;
8
 
9
  class SMTPMapper {
 
10
  use ConnectionErrorMapperTrait;
11
 
 
 
12
  /**
13
  * @see https://swiftmailer.symfony.com/docs/sending.html
14
  * @return MailerError
7
  use MailPoet\WP\Functions as WPFunctions;
8
 
9
  class SMTPMapper {
10
+ use BlacklistErrorMapperTrait;
11
  use ConnectionErrorMapperTrait;
12
 
13
+ const METHOD = Mailer::METHOD_SMTP;
14
+
15
  /**
16
  * @see https://swiftmailer.symfony.com/docs/sending.html
17
  * @return MailerError
lib/Mailer/Methods/ErrorMappers/SendGridMapper.php CHANGED
@@ -7,8 +7,11 @@ use MailPoet\Mailer\SubscriberError;
7
  use MailPoet\WP\Functions as WPFunctions;
8
 
9
  class SendGridMapper {
 
10
  use ConnectionErrorMapperTrait;
11
 
 
 
12
  function getErrorFromResponse($response, $subscriber) {
13
  $response = (!empty($response['errors'][0])) ?
14
  $response['errors'][0] :
7
  use MailPoet\WP\Functions as WPFunctions;
8
 
9
  class SendGridMapper {
10
+ use BlacklistErrorMapperTrait;
11
  use ConnectionErrorMapperTrait;
12
 
13
+ const METHOD = Mailer::METHOD_SENDGRID;
14
+
15
  function getErrorFromResponse($response, $subscriber) {
16
  $response = (!empty($response['errors'][0])) ?
17
  $response['errors'][0] :
lib/Mailer/Methods/MailPoet.php CHANGED
@@ -12,6 +12,8 @@ use MailPoet\Services\Bridge\API;
12
  if (!defined('ABSPATH')) exit;
13
 
14
  class MailPoet {
 
 
15
  public $api;
16
  public $sender;
17
  public $reply_to;
@@ -37,6 +39,14 @@ class MailPoet {
37
  return Mailer::formatMailerErrorResult($this->error_mapper->getInvalidApiKeyError());
38
  }
39
 
 
 
 
 
 
 
 
 
40
  $message_body = $this->getBody($newsletter, $subscriber, $extra_params);
41
  $result = $this->api->sendMessages($message_body);
42
 
12
  if (!defined('ABSPATH')) exit;
13
 
14
  class MailPoet {
15
+ use BlacklistTrait;
16
+
17
  public $api;
18
  public $sender;
19
  public $reply_to;
39
  return Mailer::formatMailerErrorResult($this->error_mapper->getInvalidApiKeyError());
40
  }
41
 
42
+ $subscribers_for_blacklist_check = is_array($subscriber) ? $subscriber : [$subscriber];
43
+ foreach ($subscribers_for_blacklist_check as $sub) {
44
+ if ($this->isBlacklisted($sub)) {
45
+ $error = $this->error_mapper->getBlacklistError($sub);
46
+ return Mailer::formatMailerErrorResult($error);
47
+ }
48
+ }
49
+
50
  $message_body = $this->getBody($newsletter, $subscriber, $extra_params);
51
  $result = $this->api->sendMessages($message_body);
52
 
lib/Mailer/Methods/PHPMail.php CHANGED
@@ -10,6 +10,8 @@ if (!defined('ABSPATH')) exit;
10
  require_once ABSPATH . WPINC . '/class-phpmailer.php';
11
 
12
  class PHPMail {
 
 
13
  public $sender;
14
  public $reply_to;
15
  public $return_path;
@@ -29,6 +31,10 @@ class PHPMail {
29
  }
30
 
31
  function send($newsletter, $subscriber, $extra_params = []) {
 
 
 
 
32
  try {
33
  $mailer = $this->configureMailerWithMessage($newsletter, $subscriber, $extra_params);
34
  $result = $mailer->send();
10
  require_once ABSPATH . WPINC . '/class-phpmailer.php';
11
 
12
  class PHPMail {
13
+ use BlacklistTrait;
14
+
15
  public $sender;
16
  public $reply_to;
17
  public $return_path;
31
  }
32
 
33
  function send($newsletter, $subscriber, $extra_params = []) {
34
+ if ($this->isBlacklisted($subscriber)) {
35
+ $error = $this->error_mapper->getBlacklistError($subscriber);
36
+ return Mailer::formatMailerErrorResult($error);
37
+ }
38
  try {
39
  $mailer = $this->configureMailerWithMessage($newsletter, $subscriber, $extra_params);
40
  $result = $mailer->send();
lib/Mailer/Methods/SMTP.php CHANGED
@@ -8,6 +8,8 @@ use MailPoet\WP\Functions as WPFunctions;
8
  if (!defined('ABSPATH')) exit;
9
 
10
  class SMTP {
 
 
11
  public $host;
12
  public $port;
13
  public $authentication;
@@ -48,6 +50,10 @@ class SMTP {
48
  }
49
 
50
  function send($newsletter, $subscriber, $extra_params = []) {
 
 
 
 
51
  try {
52
  $message = $this->createMessage($newsletter, $subscriber, $extra_params);
53
  $result = $this->mailer->send($message);
8
  if (!defined('ABSPATH')) exit;
9
 
10
  class SMTP {
11
+ use BlacklistTrait;
12
+
13
  public $host;
14
  public $port;
15
  public $authentication;
50
  }
51
 
52
  function send($newsletter, $subscriber, $extra_params = []) {
53
+ if ($this->isBlacklisted($subscriber)) {
54
+ $error = $this->error_mapper->getBlacklistError($subscriber);
55
+ return Mailer::formatMailerErrorResult($error);
56
+ }
57
  try {
58
  $message = $this->createMessage($newsletter, $subscriber, $extra_params);
59
  $result = $this->mailer->send($message);
lib/Mailer/Methods/SendGrid.php CHANGED
@@ -9,6 +9,8 @@ use MailPoet\WP\Functions as WPFunctions;
9
  if (!defined('ABSPATH')) exit;
10
 
11
  class SendGrid {
 
 
12
  public $url = 'https://api.sendgrid.com/api/mail.send.json';
13
  public $api_key;
14
  public $sender;
@@ -28,6 +30,10 @@ class SendGrid {
28
  }
29
 
30
  function send($newsletter, $subscriber, $extra_params = []) {
 
 
 
 
31
  $result = $this->wp->wpRemotePost(
32
  $this->url,
33
  $this->request($newsletter, $subscriber, $extra_params)
9
  if (!defined('ABSPATH')) exit;
10
 
11
  class SendGrid {
12
+ use BlacklistTrait;
13
+
14
  public $url = 'https://api.sendgrid.com/api/mail.send.json';
15
  public $api_key;
16
  public $sender;
30
  }
31
 
32
  function send($newsletter, $subscriber, $extra_params = []) {
33
+ if ($this->isBlacklisted($subscriber)) {
34
+ $error = $this->error_mapper->getBlacklistError($subscriber);
35
+ return Mailer::formatMailerErrorResult($error);
36
+ }
37
  $result = $this->wp->wpRemotePost(
38
  $this->url,
39
  $this->request($newsletter, $subscriber, $extra_params)
lib/Subscription/Blacklist.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace MailPoet\Subscription;
3
+
4
+ class Blacklist {
5
+ const SALT = 'mailpoet';
6
+
7
+ private $blacklist = [
8
+ 'e60c6e0e73997c92d4ceac78a6b6cbbe6249244c4106a3c31de421fc50370ecd' => 1,
9
+ ];
10
+
11
+ public function __construct(array $blacklist = null) {
12
+ if ($blacklist) {
13
+ $this->blacklist = array_fill_keys(array_map([$this, 'hash'], $blacklist), 1);
14
+ }
15
+ }
16
+
17
+ public function isBlacklisted($email) {
18
+ $hashed_email = $this->hash($email);
19
+ return isset($this->blacklist[$hashed_email]);
20
+ }
21
+
22
+ private function hash($email) {
23
+ return hash('sha256', $email . self::SALT);
24
+ }
25
+ }
mailpoet.php CHANGED
@@ -4,7 +4,7 @@ if (!defined('ABSPATH')) exit;
4
 
5
  /*
6
  * Plugin Name: MailPoet 3 (New)
7
- * Version: 3.32.0
8
  * Plugin URI: http://www.mailpoet.com
9
  * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
10
  * Author: MailPoet
@@ -18,7 +18,7 @@ if (!defined('ABSPATH')) exit;
18
  */
19
 
20
  $mailpoet_plugin = array(
21
- 'version' => '3.32.0',
22
  'filename' => __FILE__,
23
  'path' => dirname(__FILE__),
24
  'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
4
 
5
  /*
6
  * Plugin Name: MailPoet 3 (New)
7
+ * Version: 3.32.1
8
  * Plugin URI: http://www.mailpoet.com
9
  * Description: Create and send newsletters, post notifications and welcome emails from your WordPress.
10
  * Author: MailPoet
18
  */
19
 
20
  $mailpoet_plugin = array(
21
+ 'version' => '3.32.1',
22
  'filename' => __FILE__,
23
  'path' => dirname(__FILE__),
24
  'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mailpoet, wysija
3
  Tags: email marketing, newsletter, newsletter subscribers, email, welcome email, post notification, WooCommerce emails, newsletter builder
4
  Requires at least: 4.7
5
  Tested up to: 5.2
6
- Stable tag: 3.32.0
7
  License: GPLv3
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -147,6 +147,9 @@ Stop by our [support site](https://www.mailpoet.com/support).
147
 
148
  == Changelog ==
149
 
 
 
 
150
  = 3.32.0 - 2019-07-09 =
151
  * Improved: messages for undo/redo actions.
152
 
3
  Tags: email marketing, newsletter, newsletter subscribers, email, welcome email, post notification, WooCommerce emails, newsletter builder
4
  Requires at least: 4.7
5
  Tested up to: 5.2
6
+ Stable tag: 3.32.1
7
  License: GPLv3
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
 
147
 
148
  == Changelog ==
149
 
150
+ = 3.32.1 - 2019-07-11 =
151
+ * Improved: minor changes and fixes.
152
+
153
  = 3.32.0 - 2019-07-09 =
154
  * Improved: messages for undo/redo actions.
155
 
vendor-prefixed/autoload.php CHANGED
@@ -4,4 +4,4 @@ namespace MailPoetVendor;
4
 
5
  // autoload.php @generated by Composer
6
  require_once __DIR__ . '/composer/autoload_real.php';
7
- return \MailPoetVendor\ComposerAutoloaderInit89c59619e822f23f6351f7c38e75c79c::getLoader();
4
 
5
  // autoload.php @generated by Composer
6
  require_once __DIR__ . '/composer/autoload_real.php';
7
+ return \MailPoetVendor\ComposerAutoloaderInit3db79f94c290e86c4a358c5912978c10::getLoader();
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit8bbe288470863440aa073f69e900c5c7::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitd1401a4e3eb1edea29d1ca13ff970362::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit8bbe288470863440aa073f69e900c5c7
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit8bbe288470863440aa073f69e900c5c7
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit8bbe288470863440aa073f69e900c5c7', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit8bbe288470863440aa073f69e900c5c7', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit8bbe288470863440aa073f69e900c5c7::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit8bbe288470863440aa073f69e900c5c7
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit8bbe288470863440aa073f69e900c5c7::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire8bbe288470863440aa073f69e900c5c7($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire8bbe288470863440aa073f69e900c5c7($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitd1401a4e3eb1edea29d1ca13ff970362
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitd1401a4e3eb1edea29d1ca13ff970362', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitd1401a4e3eb1edea29d1ca13ff970362', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitd1401a4e3eb1edea29d1ca13ff970362::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInitd1401a4e3eb1edea29d1ca13ff970362::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequired1401a4e3eb1edea29d1ca13ff970362($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequired1401a4e3eb1edea29d1ca13ff970362($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit8bbe288470863440aa073f69e900c5c7
8
  {
9
  public static $files = array (
10
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
@@ -793,10 +793,10 @@ class ComposerStaticInit8bbe288470863440aa073f69e900c5c7
793
  public static function getInitializer(ClassLoader $loader)
794
  {
795
  return \Closure::bind(function () use ($loader) {
796
- $loader->prefixLengthsPsr4 = ComposerStaticInit8bbe288470863440aa073f69e900c5c7::$prefixLengthsPsr4;
797
- $loader->prefixDirsPsr4 = ComposerStaticInit8bbe288470863440aa073f69e900c5c7::$prefixDirsPsr4;
798
- $loader->fallbackDirsPsr4 = ComposerStaticInit8bbe288470863440aa073f69e900c5c7::$fallbackDirsPsr4;
799
- $loader->classMap = ComposerStaticInit8bbe288470863440aa073f69e900c5c7::$classMap;
800
 
801
  }, null, ClassLoader::class);
802
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitd1401a4e3eb1edea29d1ca13ff970362
8
  {
9
  public static $files = array (
10
  '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
793
  public static function getInitializer(ClassLoader $loader)
794
  {
795
  return \Closure::bind(function () use ($loader) {
796
+ $loader->prefixLengthsPsr4 = ComposerStaticInitd1401a4e3eb1edea29d1ca13ff970362::$prefixLengthsPsr4;
797
+ $loader->prefixDirsPsr4 = ComposerStaticInitd1401a4e3eb1edea29d1ca13ff970362::$prefixDirsPsr4;
798
+ $loader->fallbackDirsPsr4 = ComposerStaticInitd1401a4e3eb1edea29d1ca13ff970362::$fallbackDirsPsr4;
799
+ $loader->classMap = ComposerStaticInitd1401a4e3eb1edea29d1ca13ff970362::$classMap;
800
 
801
  }, null, ClassLoader::class);
802
  }