X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FObject%2FEmail.php;h=f6a72985231af6b58c42518f5664a5069fc1edc4;hb=6aa1dcfad371f34fea1f8e39b73de2cc3dd05784;hp=96a7ad88cb18f9e3af33d80ac74e7bbe3cf41a03;hpb=01640a7045e146759bc936dd499ac27738b78940;p=friendica.git diff --git a/src/Object/Email.php b/src/Object/Email.php index 96a7ad88cb..f6a7298523 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();