diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 8f63ef028d..f2c68f9376 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -264,7 +264,7 @@ class ShareByMailProvider implements IShareProvider { $emailTemplate = $this->mailer->createEMailTemplate(); $emailTemplate->addHeader(); - $emailTemplate->addHeading($this->l->t('%s shared »%s« with you', [$ownerDisplayName, $filename])); + $emailTemplate->addHeading($this->l->t('%s shared »%s« with you', [$ownerDisplayName, $filename]), false); if ($owner === $initiator) { $text = $this->l->t('%s shared »%s« with you.', [$ownerDisplayName, $filename]); diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index bfaee72bed..f82ddc689e 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -353,7 +353,8 @@ EOF; * Adds a paragraph to the body of the email * * @param string $text - * @param string $plainText Text that is used in the plain text email - if empty the $text is used + * @param string|bool $plainText Text that is used in the plain text email + * if empty the $text is used, if false none will be used */ public function addBodyText($text, $plainText = '') { if ($this->footerAdded) { @@ -369,7 +370,9 @@ EOF; } $this->htmlBody .= vsprintf($this->bodyText, [htmlspecialchars($text)]); - $this->plainBody .= $plainText . PHP_EOL . PHP_EOL; + if ($plainText !== false) { + $this->plainBody .= $plainText . PHP_EOL . PHP_EOL; + } } /** diff --git a/lib/public/Mail/IEMailTemplate.php b/lib/public/Mail/IEMailTemplate.php index d0123f2273..8e3233ee42 100644 --- a/lib/public/Mail/IEMailTemplate.php +++ b/lib/public/Mail/IEMailTemplate.php @@ -72,7 +72,8 @@ interface IEMailTemplate { * Adds a paragraph to the body of the email * * @param string $text - * @param string $plainText Text that is used in the plain text email - if empty the $text is used + * @param string|bool $plainText Text that is used in the plain text email + * if empty the $text is used, if false none will be used * * @since 12.0.0 */