Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Email body font size looks small in preview of email logs and looks slight bigger in outlook email.

Kartik Choudha1
Tera Guru

I have configured a notification where it has email body content configured in 'Message HTML' field on notification form. Body also has Table configured from email script.

 

Now the issue is this looks perfect in the Preview of the email and from the email logs table's preview as well.

But in th email of outlook the font of body is bigger and font within the table is smaller compare to what we see in the preview of an email notification.

 

Any suggestion or root cause if anybody aware of this?

4 REPLIES 4

Its_Azar
Tera Guru
Tera Guru

Hi there @Kartik Choudha1 

 

You are right i have struggled with the same in the past unfortunately – the “Preview” in ServiceNow uses a browser engine, while Outlook uses its own HTML engine. so it applies different default font sizes and line heights, especially inside tables. To get them to match, try force the font styling explicitly instead of relying on defaults. Set a consistent font/size on the <body> and on the table itself. 

give it a try

Solved: Change font size across the platform - ServiceNow Community

☑️ If this helped, please mark it as Helpful or Accept Solution so others can find the answer too.

Kind Regards,

Mohamed Azarudeen Z

Developer @ KPMG

Ankur Bawiskar
Tera Patron
Tera Patron

@Kartik Choudha1 

this is a common issue as Outlook might interpret HTML and CSS in different ways

outlook may not support all the css and styles

Emails are not formatted correctly in Outlook or older email applications 

Workaround

-> try to use inline css within both the body and table elements to increase

-> example like this <td style="font-family: Arial; font-size: 12px;">

-> try to use email template

Mini-Lab: Adding CSS To an Email Notification - Part 2 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Kartik Choudha1
Tera Guru

Hi @Ankur Bawiskar @Its_Azar 
Thanks for your responses.

Let me break down how it is written.

 

Body font text in Message HTML field is set to 'Arial' and '8pt' and it's HTML code looks like below (which doesn't include FONT SIZE)

<p><span style="font-family: arial, helvetica, sans-serif;">Dear Manager,</span></p>
<p><span style="font-family: arial, helvetica, sans-serif;">{email script name}</span><p>

 

Email script font sizing while preparing header of the table - 

template.print('<table width="100%" style ="border:1px solid black; border-collapse:collapse;font-family:Arial;font-size:10pt;"><tr style="background-color: #f1f1f1;"><th style="border:1px solid black; text-align:centre;">number</th></tr>');

 

then one template.print to get the content from Servicenow table and print under this column headers.

 

This looks perfect in email logs preview.

 

Now the suggestion is that i should give the same(email script one) font size and family in the body text as well which i configured in Message HTML field. I want to keep all the font same

Hi @Ankur Bawiskar @Its_Azar  any suggestion on last reply of me?

For now, i have added the below line in each <span> tag of HTML source code of 'Message HTML' field.

font-family:Arial;font-size:10pt;"

 

<p><span style="font-family:Arial;font-size:10pt;">Dear Manager,</span></p>
<p><span style="font-family:Arial;font-size:10pt;">{email script name}</span><p>