diff --git a/api/src/Etemplate/Widget/HtmlArea.php b/api/src/Etemplate/Widget/HtmlArea.php index b6ed91c0cb..f4a05133a5 100644 --- a/api/src/Etemplate/Widget/HtmlArea.php +++ b/api/src/Etemplate/Widget/HtmlArea.php @@ -203,7 +203,7 @@ class HtmlArea extends Etemplate\Widget * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ */ - body { + body, p, div { font-family: $font_family; font-size: $font_size; line-height: 1.4; diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 6d6af52451..bad2358c6f 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -1175,7 +1175,7 @@ class mail_compose if ($content['mimeType'] === 'html') { $start = "
\n"; - $before = $disableRuler ? '' : '
'; + $before = $disableRuler ? '' : '
'; $inbetween = ''; } else @@ -2392,13 +2392,9 @@ class mail_compose */ static function wrapBlockWithPreferredFont($content, $legend, $class=null) { - $options = '';/*' style="border: 2px solid silver; border-left: none; border-right: none;'. - 'font-family: '.($GLOBALS['egw_info']['user']['preferences']['common']['rtf_font'] ?? 'arial, helvetica, sans-serif'). - '; font-size: '.($GLOBALS['egw_info']['user']['preferences']['common']['rtf_size'] ?? '10').'pt"';*/ - if (!empty($class)) $options = ' class="'.htmlspecialchars($class).'"'; - return Api\Html::fieldset($content, $legend, $options); + return Api\Html::fieldset($content, $legend, $options ?? ''); } /** @@ -2542,9 +2538,17 @@ class mail_compose case 'html': $body = "\n".$_formData['body']; + if (!empty($attachment_links)) { - if (strpos($body, '') !== false) + // if we have a ruler, replace it with the attachment block + static $ruler = '
]*>#', $attachment_links, $body); + } + // else place it before the signature + elseif (strpos($body, '') !== false) { $body = str_replace('', $attachment_links.'', $body); } @@ -2553,6 +2557,8 @@ class mail_compose $body .= $attachment_links; } } + $body = str_replace($ruler, 'setBody($this->convertHTMLToText($body, true, true). @@ -2724,7 +2730,7 @@ class mail_compose } elseif ($html) { - return '

'.lang('Download attachments').":

\n\n"; + return self::wrapBlockWithPreferredFont("\n", lang('Download attachments'), 'attachmentLinks'); } return lang('Download attachments').":\n- ".implode("\n- ", $links)."\n"; }