diff --git a/lib/private/Mail/EMailTemplate.php b/lib/private/Mail/EMailTemplate.php index fa76a21546..3442e8e943 100644 --- a/lib/private/Mail/EMailTemplate.php +++ b/lib/private/Mail/EMailTemplate.php @@ -187,10 +187,10 @@ EOF; protected $listItem = << -

+

%s

-

%s

+

%s

@@ -421,20 +421,40 @@ EOF; * Adds a list item to the body of the email * * @param string $text + * @param string $metaInfo + * @param string $icon Absolute path, must be 16*16 pixels * @param string $plainText Text that is used in the plain text email - * if empty the $text is used + * if empty the $text is used, if false none will be used + * @param string $plainMetaInfo Meta info that is used in the plain text email + * if empty the $metaInfo is used, if false none will be used * @since 12.0.0 */ - public function addBodyListItem($text, $plainText = '') { + public function addBodyListItem($text, $metaInfo = '', $icon = '', $plainText = '', $plainMetaInfo = '') { $this->ensureBodyListOpened(); if ($plainText === '') { $plainText = $text; } + if ($plainMetaInfo === '') { + $plainMetaInfo = $metaInfo; + } - $this->htmlBody .= vsprintf($this->listItem, [htmlspecialchars($text)]); + $htmlText = htmlspecialchars($text); + if ($metaInfo) { + $htmlText = '' . htmlspecialchars($metaInfo) . '
' . $htmlText; + } + if ($icon !== '') { + $icon = '•'; + } else { + $icon = '•'; + } + $this->htmlBody .= vsprintf($this->listItem, [$icon, $htmlText]); if ($plainText !== false) { - $this->plainBody .= ' * ' . $plainText . PHP_EOL; + $this->plainBody .= ' * ' . $plainText; + if ($plainMetaInfo !== false) { + $this->plainBody .= ' (' . $plainMetaInfo . ')'; + } + $this->plainBody .= PHP_EOL; } } diff --git a/lib/public/Mail/IEMailTemplate.php b/lib/public/Mail/IEMailTemplate.php index d4010618b1..6df83b4d10 100644 --- a/lib/public/Mail/IEMailTemplate.php +++ b/lib/public/Mail/IEMailTemplate.php @@ -84,11 +84,15 @@ interface IEMailTemplate { * Adds a list item to the body of the email * * @param string $text + * @param string $metaInfo + * @param string $icon Absolute path, must be 16*16 pixels * @param string $plainText Text that is used in the plain text email - * if empty the $text is used + * if empty the $text is used, if false none will be used + * @param string $plainMetaInfo Meta info that is used in the plain text email + * if empty the $metaInfo is used, if false none will be used * @since 12.0.0 */ - public function addBodyListItem($text, $plainText = ''); + public function addBodyListItem($text, $metaInfo = '', $icon = '', $plainText = '', $plainMetaInfo = ''); /** * Adds a button group of two buttons to the body of the email