Ensure IEMail::getMessage returns a string

This commit is contained in:
Hypolite Petovan 2022-11-19 19:08:44 -05:00
parent 2a4985cd46
commit a147038c2e
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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 ?? '';
}
}