Change font and font size in email script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 07:24 AM
Hi all,
We are using email client templates all with the format Font=Source Sans Pro, Font size = 12. However, when we use the reply/ reply all/ forward buttons in an Email received/ sent in the instance, the text generated by the called email script include - insert_original_email_message - is set to Font=Verdana, Font size = 8.
So if I click anywhere except on the text below, font is SSP size 12. The text itself is font V size 8.
I've googled, and tried a few variations with template.print and then the desired font and size, but none of my attempts have worked.
This is the OOB script below. Does anyone know how I need to change this so that the text generated by the email script include is also font SSP size 12? Any help would be much appreciated.
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template, if (current.type != 'received') { var cdate = new Date(); var usePlainTextResponseContent = gs.getProperty('glide.email_client.use_plain_text_response', 'false'); if ((usePlainTextResponseContent == 'true' && !current.body_text.isNil()) || current.body.isNil()) { |
The information in the email client template is:
font-family: 'Source Sans Pro', verdana, sans-serif; font-size: 12pt;
Kind regards,
Thrishna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2020 10:35 AM
Unfortunately the source code of sn_notification.EmailResponse.getOriginalEmailHtml is not publicly available.
Therefore try to wrap it with HTML-Code that overrides the styles, for example:
template.print("<div style='font-family:Source Sans Pro !important;font-size:12px !important'>");
template.print(sn_notification.EmailResponse.getOriginalEmailHtml(current.getUniqueValue()));
template.print("</div>");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2020 12:23 AM
Hi Trishna
Did my reply answer your question?
If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
If not, please tell me what is still missing.
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2021 06:56 AM
Hello Maik,
Sorry for the late reply. I've had some time off from work.
The wrapping seemed to do the trick. The font and size were showing the right values (although I did have to bump it up to 16 px to get size 12 pt?).
However, as you can see in the picture below, it's still not really giving me the right font. The left 'TEMPLATE' is Source Sans Pro, the right one, that I typed in after opening the email window, is something else. But in the font picker both show as SSP.
When I go to the mailbox where I receive our dev instance emails it contains several fonts and sizes.
Yellow underline = Calibri (default font of my outlook - in the ServiceNow Email Client it was showing this text as SSP)
Green underline = SSP
So wrapping it shows the right values on the surface, but in reality it doesn't seem to change much. Thanks for the suggestion though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2021 09:33 PM
Without having a look in your instance it is hard to say what is going wrong.
I just found another interesting approach you could try: https://blog.tgxn.net/applying-global-css-to-notifications/