| 1234567891011121314151617181920212223242526272829 |
- <?php
- namespace cx_newsletter;
- use \Exception;
- class single_mail {
- public string $title = '';
- public string $content = '';
- public array $headers = [];
- public bool $is_html = false;
- public ?string $to = null;
- public ?string $reply_to = null;
- public function is_good() : bool {
- return $this->validate() === null;
- }
- public function validate() : ?string {
- if ($this->reply_to === null) {
- return 'Reply to is not set in email.';
- }
- if ($this->to === null) {
- return 'Target email is not set.';
- }
- return null;
- }
- }
|