diff --git a/src/Object/EMail/IEmail.php b/src/Object/EMail/IEmail.php index f1e66a224f..9fd1fe3da6 100644 --- a/src/Object/EMail/IEmail.php +++ b/src/Object/EMail/IEmail.php @@ -80,7 +80,7 @@ interface IEmail extends JsonSerializable * * @return string */ - function getMessage(bool $plain = false); + function getMessage(bool $plain = false): string; /** * Gets the additional mail header array diff --git a/src/Object/Email.php b/src/Object/Email.php index 57eb0c17e9..4d5a11715c 100644 --- a/src/Object/Email.php +++ b/src/Object/Email.php @@ -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 ?? ''; } }