X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FObject%2FEmail.php;h=fdde4e96ddd751a329f4e16e434acdaddd79607f;hb=c2c563be26697169f734f2654ab491a4e8ffff2f;hp=96a7ad88cb18f9e3af33d80ac74e7bbe3cf41a03;hpb=8293d5ed0af78ae6cc5629bb1f982a7b29794d32;p=friendica.git diff --git a/src/Object/Email.php b/src/Object/Email.php index 96a7ad88cb..fdde4e96dd 100644 --- a/src/Object/Email.php +++ b/src/Object/Email.php @@ -1,6 +1,6 @@ fromName = $fromName; $this->fromAddress = $fromAddress; @@ -110,12 +110,12 @@ class Email implements IEmail /** * {@inheritDoc} */ - public function getMessage(bool $plain = false) + public function getMessage(bool $plain = false): string { if ($plain) { return $this->msgText; } else { - return $this->msgHtml; + return $this->msgHtml ?? ''; } } @@ -127,6 +127,26 @@ class Email implements IEmail return $this->additionalMailHeader; } + /** + * {@inheritDoc} + */ + public function getAdditionalMailHeaderString() + { + $headerString = ''; + + foreach ($this->additionalMailHeader as $name => $values) { + if (!is_array($values)) { + $values = [$values]; + } + + foreach ($values as $value) { + $headerString .= "$name: $value\r\n"; + } + } + + return $headerString; + } + /** * {@inheritDoc} */ @@ -180,6 +200,7 @@ class Email implements IEmail /** * @inheritDoc */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->toArray();