We want to process errors for individual subscribers. Subscriber errors were inlined into error message string. This commit changes this so that we are now able to get subscriber errors as a data which are easy to process further. [MAILPOET-1154]
39 lines
624 B
PHP
39 lines
624 B
PHP
<?php
|
|
namespace MailPoet\Mailer;
|
|
|
|
class SubscriberError {
|
|
|
|
/** @var string */
|
|
private $email;
|
|
|
|
/** @var string|null */
|
|
private $message;
|
|
|
|
/**
|
|
* @param string $email
|
|
* @param string $message|null
|
|
*/
|
|
function __construct($email, $message = null) {
|
|
$this->email = $email;
|
|
$this->message = $message;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
function getEmail() {
|
|
return $this->email;
|
|
}
|
|
|
|
/**
|
|
* @return null|string
|
|
*/
|
|
function getMessage() {
|
|
return $this->message;
|
|
}
|
|
|
|
function __toString() {
|
|
return $this->message ? $this->email . ': ' . $this->message : $this->email;
|
|
}
|
|
}
|