Add blacklist to Mailer [MAILPOET-2176]

This commit is contained in:
wxa
2019-07-10 13:14:00 +03:00
committed by Jan Jakeš
parent 84fabcfbd5
commit 9018ab8c5f
13 changed files with 125 additions and 0 deletions

View File

@ -8,6 +8,8 @@ use MailPoet\WP\Functions as WPFunctions;
if (!defined('ABSPATH')) exit;
class AmazonSES {
use BlacklistTrait;
public $aws_access_key;
public $aws_secret_key;
public $aws_region;
@ -67,6 +69,10 @@ class AmazonSES {
}
function send($newsletter, $subscriber, $extra_params = []) {
if ($this->isBlacklisted($subscriber)) {
$error = $this->error_mapper->getBlacklistError($subscriber);
return Mailer::formatMailerErrorResult($error);
}
try {
$result = $this->wp->wpRemotePost(
$this->url,