Files
piratepoet/lib/Mailer/SubscriberError.php
Rostislav Wolny 223c2e1562 Add subscriber errors passing via MailerError object
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]
2018-09-13 09:48:54 +02:00

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;
}
}