How to write a HTML code from Email notification script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2019 10:13 AM
Hi,
I have below lines of code which i want to call in notification script.
<table style="font-weight: 500; font-family: museo-slab,sans-serif; border: 0px solid black; border-spacing: 0; width: 100%; text-align: center; max-width: 800px; margin: auto; background-color: rgba(228, 228, 228, 1);">
<thead style="background-color: white;"></thead>
<tbody>
<tr>
<td style="height: 120px; width: 100%; text-align: center; max-width: 800px; margin: auto; background-color: rgba(228, 228, 228, 1);" colspan="5">${mail_script:notification_logo1}</td>
</tr>
<tr>
<td style="width: 100px;" colspan="1"> </td>
<td style="height: 40px;" colspan="3">
<p style="text-align: left;"><span style="text-align: left; font-family: museo-slab,sans-serif;"><span style="font-weigth: 500;">Initiative Product (${URI_REF}) has been submitted and is being reviewed by <strong>${u_project_manager}</strong>.</span></span></p>
<p> </p>
</td>
<td style="width: 100px;" colspan="1"> </td>
</tr>
<tr>
<td style="width: 100px;" colspan="1"> </td>
<td style="background-color: #e6e7e8; color: #396b53; text-align: left;" colspan="3"><span style="font-family: 'museo-sans', sans-serif;"><strong>Title</strong></span></td>
<td style="width: 100px;" colspan="1"> </td>
</tr>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2019 10:22 AM
Hi there,
On the What it will contain section, on the Message HTML field, choose Source code. Simply put your code in there.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
LinkedIn
Community article list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2019 10:43 AM
Sir,
I want this to be written in Notification Scirpt. Since i want to display the same content to almost 20+ notifications. I thought of using Email template but only half of body will be same but after half may change for few notifications.
So i decided to go with Notification script let me know if you have any other suggestions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2019 10:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2019 05:46 PM
For this same requirement I created an Email Template and pasted in the HTML (so you can see the render) then used the GlideRecord API to retrieve the HTML from the Template record and print it in from the Notification Script.
Nothing irks me more than seeing HTML code in a JS script!
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022