Add basic interface for MailerMethod
[MAILPOET-4115]
This commit is contained in:
committed by
Veljko V
parent
eb07872d13
commit
b10c30a7b1
@ -7,7 +7,7 @@ use MailPoet\Mailer\Methods\Common\BlacklistCheck;
|
||||
use MailPoet\Mailer\Methods\ErrorMappers\SendGridMapper;
|
||||
use MailPoet\WP\Functions as WPFunctions;
|
||||
|
||||
class SendGrid {
|
||||
class SendGrid implements MailerMethod {
|
||||
public $url = 'https://api.sendgrid.com/api/mail.send.json';
|
||||
public $apiKey;
|
||||
public $sender;
|
||||
@ -35,7 +35,7 @@ class SendGrid {
|
||||
$this->blacklist = new BlacklistCheck();
|
||||
}
|
||||
|
||||
public function send($newsletter, $subscriber, $extraParams = []) {
|
||||
public function send($newsletter, $subscriber, $extraParams = []): array {
|
||||
if ($this->blacklist->isBlacklisted($subscriber)) {
|
||||
$error = $this->errorMapper->getBlacklistError($subscriber);
|
||||
return Mailer::formatMailerErrorResult($error);
|
||||
|
Reference in New Issue
Block a user