Methods
2 weeks ago
WordPress
8 months ago
Mailer.php
2 years ago
MailerError.php
2 years ago
MailerFactory.php
1 year ago
MailerLog.php
1 year ago
MetaInfo.php
2 months ago
SubscriberError.php
3 years ago
index.php
3 years ago
SubscriberError.php
46 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Mailer; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | class SubscriberError { |
| 9 | |
| 10 | /** @var string */ |
| 11 | private $email; |
| 12 | |
| 13 | /** @var string|null */ |
| 14 | private $message; |
| 15 | |
| 16 | /** |
| 17 | * @param string $email |
| 18 | * @param string $message|null |
| 19 | */ |
| 20 | public function __construct( |
| 21 | $email, |
| 22 | $message = null |
| 23 | ) { |
| 24 | $this->email = $email; |
| 25 | $this->message = $message; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * @return string |
| 30 | */ |
| 31 | public function getEmail() { |
| 32 | return $this->email; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @return null|string |
| 37 | */ |
| 38 | public function getMessage() { |
| 39 | return $this->message; |
| 40 | } |
| 41 | |
| 42 | public function __toString() { |
| 43 | return $this->message ? $this->email . ': ' . $this->message : $this->email; |
| 44 | } |
| 45 | } |
| 46 |