- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 01:24 AM
Hi Experts,
Need your help in formatting my mail script font/style to be consistent with the Notification we have.
We have a notification which per checking is using Arial font, size 12. This notification is calling a mail script.
Now, when the notification is viewed they have different Font and Style. I have added below line of code to my mail script but not helping. template.print('<p><font size="3" color="#000000" face="arial">');
Please help!
Mail Script
Notification Preview:
HTML source code of Notification
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Hi,</span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">An Asset Transfer Request has been approved and the below task is required to be completed: </span></p>
<p> </p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;"><strong>${number} - ${short_description}</strong></span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Opened by: ${opened_by} on ${opened_at}</span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Description: </span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">${description}</span></p>
<p> </p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Request: ${request_item.request.number} - ${request_item.request.short_description}</span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Request item: ${request_item.number} - ${request_item.cat_item}</span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Request opened: ${request_item.request.opened_at} </span></p>
<p> </p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><span style="font-family: arial, helvetica, sans-serif; color: #000000;">${mail_script:task_asset_transfer}</span></span></p>
<p> </p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: 12pt;">${mailto:mailto.close_task}</span></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div align="center">${mail_script:ah_item_view_sc_task}</div>
<p> </p>
<p> </p>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 03:13 AM
Hello
try with this script i think it applied but we did not apply the correct CSS try below code
template.print('<p style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;>")
template.print("Transfer To Location: " + item.variable_pool.transfer_to_location.getDisplayValue());
template.print( "<br /></p>");
template.print('<style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">')
template.print("Transfer To Business Unit: " + item.variable_pool.transfer_to_bu.getDisplayValue());
template.print( "<br /></p>");
template.print('<p style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">')
template.print( "Transfer To Cost Centre: "+ item.variable_pool.transfer_to_cost_center.getDisplayValue());
template.print( "<br /></p>");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 03:13 AM
Hello
try with this script i think it applied but we did not apply the correct CSS try below code
template.print('<p style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;>")
template.print("Transfer To Location: " + item.variable_pool.transfer_to_location.getDisplayValue());
template.print( "<br /></p>");
template.print('<style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">')
template.print("Transfer To Business Unit: " + item.variable_pool.transfer_to_bu.getDisplayValue());
template.print( "<br /></p>");
template.print('<p style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">')
template.print( "Transfer To Cost Centre: "+ item.variable_pool.transfer_to_cost_center.getDisplayValue());
template.print( "<br /></p>");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 03:18 AM
Thank you, Mohith! This solves my issue 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 02:46 AM
You want email script text similar to text shown as part of notification, right? if yes then try below,
template.print("<p style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Transfer To Location: " + item.variable_pool.transfer_to_location.getDisplayValue() + "<br /></p>");
template.print("<p style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Transfer To Business Unit: " + item.variable_pool.transfer_to_bu.getDisplayValue() + "<br /></p>");
template.print( "<p style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000;">Transfer To Cost Centre: "+ item.variable_pool.transfer_to_cost_center.getDisplayValue()+"</br ></p>");
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Community Rising Star 2022
Regards,
Abhijit
ServiceNow MVP