
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2020 10:58 PM
Is it possible to read System properties from email layout?
We would like to read ie. fonts and notification colors from system properties instead of hardcoding those to the email layout. I haven't figured out a way to access system properties from email layouts, is there a way?
Here is example:
<td style=" padding: 15px 0px 0px 0px; text-align: left; font-family: Helvetica,Arial,sans-serif; color:#323232;">
${notification:body}
</td>
We would like to define the font-family and the color in sys_properties, so we could re use the same values and upate all at once if there is any changes.
Solved! Go to Solution.
- Labels:
-
Notifications

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2020 11:39 PM
Hi,
- Add <p>${mail_script:notification_email.styles}</p>.
- Navigate to System Notification > Email > Notifications Email Scripts.
- Click New: "Notification_email.styles"
- On the your email script:
var stylesheet = new GlideRecord ('sp_css');
stylesheet.get('name','company_email_notifications.css'); //Stylesheet for email styling
template.print('<div><style>' + stylesheet.css + '</style></div>');
3. Navigate to System Notification > Email > Notifications.
4. Open the email notification record that should use the template.
5. Navigate to the What it will contain section.
6. From the Email Template field, select the appropriate template.
7. Click Update.
Please mark correct or helpful if this helps.
Thanks
Swapnil

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2020 01:55 AM
Hey,
Feel good that it's helpful to you. And for further issue please go through these links so you get an idea to use CSS in email scripting
https://community.servicenow.com/community?id=community_blog&sys_id=438c2ae1dbd0dbc01dcaf3231f9619fe
https://community.servicenow.com/community?id=community_blog&sys_id=cd9daa69dbd0dbc01dcaf3231f961963
If this helpful please mark helpful.
Thanks
Swapnil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2021 09:18 AM
Hi Soni,
Where the email script should be pasted in Notification or email template??
I don't see any style sheet property "company_email_notifications.css" in my instance. Can you please help with that.
Thank you 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2020 02:14 AM
Hi
Have you tried to use Mail Scripts in your Layout? Maybe you just can use it like in the Notification itself?
Let me know.
BR
Dirk