Notifications: Email Template Question (Outlook adding white space)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 10:20 AM
Hi, does anyone know why email notifications sent from ServiceNow render with a double-spaced look between each printed line in Outlook, but when previewing the emails in ServiceNow there is not a space between each printed line?
Our email templates place <div> tags around each printed line so I'm thinking this is causing Outlook to render each printed line as a taller line resulting in what looks like a space beneath each line.
For example: This is from the OOB email template named: change.itil.approve.role:
<div>Short Description: ${sysapproval.short_description}</div>
<div>Priority: ${sysapproval.priority}</div>
<div>Category: ${sysapproval.category}</div>
In the ServiceNow previewer, these lines print one after the other, but in Outlook it looks like this:
If you highlight a line, you can see it's actually only one line, there is no extra line beneath each printed line. It's just that each printed line is taking up a taller space than just the printed text:
I noticed the Approval Activity script places all of the approvers within a single <div> and also has a <br> after each name, and this doesn't show up as double-spaced in Outlook.
Is they key to add <br> after each template.print statement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 10:27 AM
Hi @Justin Docken,
Try with out <div> tags. Update notification should be like-
Short Description: ${sysapproval.short_description}
Priority: ${sysapproval.priority}
Category: ${sysapproval.category}
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 10:34 AM
Hi Sagar,
Yes, in rich text view, the notification looks like this:
but this results in a double-spaced look in Outlook.
When you click the button above to view source code, it looks like this:
In the ServiceNow email previewer each line is printed without any space between each line whereas when we see the email in Outlook there appears to be a space between each line.
I read something somewhere that in fact the <br/> should create a soft line break and eliminate the double-spaced look in Outlook. I have no good way of testing this without deploying my changes to Production and waiting for an email to come through to see what it looks like in Outlook.
Even the https://www.w3schools.com/html/tryit.asp?filename=tryhtml_editors previews the same without double spacing.
It would be really nice to find an HTML viewer that mimics Outlook.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 10:43 AM
Hi @Justin Docken,
Copy the Priority, Short description and description line from approval notification add it to your notifications and just modify it as per variables/field names. It will work for you.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 11:00 AM
I think I've determined using <br/> within the HTML code will resolve the issue of only Outlook rendering lines as double spaced.
This occurs when using <div> or <p> tags within your email notification, and apparently can be resolved by using a <br/> within each printed line