Hi, sorry for replying to this >1 year old ticket, but I also came across this issue and its really annoying having all html emails with the browsers default font, usually Times New Roman.
So, anyway, I've solved this issue by doing the following: (hint: I'm using otrs 6 beta 4)
Create an "HTMLEmailStyle.tt" file inside Kernel/Output/HTML/Templates/Standard (or Templates/YourCustomTPL) with the following contents:
Code: Select all
<style type="text/css">
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 0.8em;
}
</style>
Of course, you can edit the font and size to your liking.
Then, edit the file "Kernel/Output/HTML/Layout.pm" and at around line 4722 (after the "# safety check" condition) add the following:
Code: Select all
# custom html styles BEGIN
my $MailStyle = $Self->Output( TemplateFile => 'HTMLEmailStyle' );
# Add it to the beginning of the head, if possible, otherwise prepend it.
if ( $Param{Data}->{Content} =~ /<head.*?>/si ) {
$Param{Data}->{Content} =~ s/(<head.*?>)/$1\n$MailStyle/si;
}
else {
$Param{Data}->{Content} = $MailStyle . $Param{Data}->{Content};
}
# custom html styles END
I've based the changes on the code that inserts the "To protect your privacy, remote content was blocked. Load blocked content." message into the html email but changed it to add the style in the <head> instead of the <body>.
So far, this change seems to be working just fine without any side-effects.
It would be great to have a sysconfig option to configure this type of override in a future version.
Hope it helps