Format E-mail Received by OTRS

Moderator: crythias

Post Reply
jff
Znuny newbie
Posts: 52
Joined: 23 Mar 2016, 14:17
Znuny Version: 6.0.8
Real Name: Jeff
Company: M

Format E-mail Received by OTRS

Post by jff »

Hello,

I'm using OTRS 4 and OTRS receives e-mails and create a follow up on existing ticket if the TT number on subject matches.

This is working great but the e-mail that I send to OTRS and creates a follow-up has a different font and I want to change that.

See this Image (http://imgur.com/tsQZ0LE)

Using the FF tool I found this class:

Code: Select all

.ArticleMailContent {
    padding: 11px 12px;
    line-height: 1.3;
}
I went ahead and edited the Core.TicketDetail.css

Code: Select all

.ArticleMailContent {
    padding: 11px 12px;
    line-height: 1.3;
    font-family: tahoma,verdana,arial,sans-serif;
}
I can see this now in FF but no changes to the text.

How can I change the dafault font family for incoming email follow ups?

Thanks
jff
Znuny newbie
Posts: 52
Joined: 23 Mar 2016, 14:17
Znuny Version: 6.0.8
Real Name: Jeff
Company: M

Re: Format E-mail Received by OTRS

Post by jff »

Anyone?

I might be getting messed by all the css-cache thing, but I'm not sure how that work, all changes I do to the core seem to be on css-cache already. Is there anything else I can do?
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Format E-mail Received by OTRS

Post by jojo »

On html mails the sender defines the font. There is no possibility to change this
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
jff
Znuny newbie
Posts: 52
Joined: 23 Mar 2016, 14:17
Znuny Version: 6.0.8
Real Name: Jeff
Company: M

Re: Format E-mail Received by OTRS

Post by jff »

Hello Jojo,

thanks for your reply.

I am using Outlook 2010 to send a message and my default font is Calibri, you can see in the image above that when OTRS parses it it show in Times New Roman (not sure if that's the font)

I trying to dig this deeper but it looks like it's no easy at all.

Right now I'm stuck because there is an Iframe that calls like a new page and from what I understood the meta tag converts to MS Word and then display in OTRS, see below:

Code: Select all

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
You can see there is some font-family in there but this is also being neglected by the system.

I'm lost in this, I thought it would be just a matter of adding a class but it sure doesn't seem like it.
lido
Znuny newbie
Posts: 70
Joined: 25 Oct 2017, 16:21
Znuny Version: 6.0.5

Re: Format E-mail Received by OTRS

Post by lido »

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
Post Reply