How to write a HTML code from Email notification script

shaik_irfan
Tera Guru

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">&nbsp;</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&nbsp;<strong>${u_project_manager}</strong>.</span></span></p>
<p>&nbsp;</p>
</td>
<td style="width: 100px;" colspan="1">&nbsp;</td>
</tr>
<tr>
<td style="width: 100px;" colspan="1">&nbsp;</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">&nbsp;</td>
</tr>

 

 

5 REPLIES 5

Mark Roethof
Tera Patron
Tera Patron

Hi there,

On the What it will contain section, on the Message HTML field, choose Source code. Simply put your code in there.

find_real_file.png

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

LinkedIn

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

Hi,

template.print has to be used to print all line in mail script.

I used this:

find_real_file.png

 

Output is as below:

find_real_file.png


Thanks,
Ashutosh

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