
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 04-19-2018 04:58 AM
When talking about user experience, it is important to have a personalized and consistent branding to company communications. Let's face it - email remains one of the best ways to communicate to end users. As such, when users receive ServiceNow email notifications (especially on a setup where a company uses other systems that send out email notifications as well), it is important that these notifications convey the same branding used throughout the company.
Using Email Layout on Email Notifications
This is not well known but we can already use the OOB email layout functionality of ServiceNow to design company branding of outbound emails. These email layout can then be applied to all our email notification record via Email Templates.
Simply follow the setup below to have a reusable email layout across your email notifications.
A. Setup your Email Layout
- If you already have one, just skip this and copy the sys_id. If not then keep reading 🙂
- Just search for Layouts on the navigator (System Policy > Email > Layouts)
- Create a new one or duplicate the existing OOB email layouts and modify to adhere to your company's branding.
- Be mindful where you want the actual content from your email notification will be placed.
- Once you identified which part of your email layout the notification body should be replaced by system with the actual body generated by your Email Notification record, add the text ${notification:body}
NOTES:
- If we update this email layout in the future, we don't have to adjust other configuration in the system. All new emails will just follow the new layout.
- (Optional) Create another Email Layout for other departments, special events or other use cases as needed
- (For email layout on scheduled reports) Copy the sys_id of this email layout as we will use it on the business rule later.
B. Setup an Email Template
- Create an Email Template record and just fill out the Email Layout reference field (the one we created above)
- You can leave the table field empty so that you can use this layout on all notifications on any table.
- You should create 1 Email template record for each Email Layout you have created.
C. Apply to your Email Notifications
- Now, you need to update the Email Template reference field on all your Email Notification records where you want to apply the email layout.
- Please ensure that the notifications you will modify are not using OOB email templates. If they are, analyze first what is it on the OOB email template that you need to migrate to the notification record itself or on your new email template. (we suggest that you create a copy of any OOB notification record instead of directly modifying it and just deactivate the OOB one so you retain a reference record)
Using the same Email Layout on Scheduled Reports
Now on this part, we are sharing a simple workaround to implement consistent company branding to outbound emails even with scheduled reports.
We evolved the answer we received and now we can selectively apply email layouts to scheduled reports.
A. Setup your Business Rule to apply the email layout
- Search for Business Rules on the navigator
- This business rule will only apply if the [use:emaillayout] text is found on the body of scheduled report. It will not touch other outbound emails on the system
- BR SETUP (in case the community portal acts up again and wont load the images)
-
Table: sys_email Advanced: true When: before Insert: true Filter conditions: Body contains [use:emaillayout]
- On Advanced tab, place the code below and replace the sys_id with sys_id of your email layout
-
(function executeRule(current, previous /*null when async*/) { var gr = new GlideRecord("sys_email_layout"); if(gr.get("sys_id", "insert sys_id of email template here")) { var layout = gr.layout; } var mybody = layout.replace('${notification:body}', current.body); current.body = mybody.replaceAll('[use:emaillayout]',''); })(current, previous);
B. Setup your Scheduled Report to use the Email Layout we created
- Setup your scheduled report as usual
- Now on the Introductory message (report_body) of the scheduled report, add the text [use:emaillayout] anywhere so that it will trigger the business rule we created earlier (this will be removed by our business rule so it wont appear on final email)
Now test your scheduled report and it should use the email layout we created.
The great thing about this workaround is it wont affect other notifications in your system that doesn't have the [use:emaillayout] text in the body and you can actually create multiple email layouts (perhaps for different departments or special events) and just duplicate the business rule we have and modify it with the sys_id of the other Email Layout and change the trigger text string for it.
You can use this for email notifications as well (though I strongly suggest that you do some reading about Email Layouts, Email Templates and Email Notifications first so you have a full understanding on how to best utilize the OOB features)
It would be best if ServiceNow can actually just allow us to use Email Layouts for Scheduled reports out of the box. But until such time, we can use this workaround for Scheduled Reports.
Hopefully this will help you apply your company branding to ServiceNow email notifications (everyone should do it, make your emails more personal!)
Don't forget to click the button below. Cheers!
Originally published during Kingston release, Updated 03/18/2022 on San Diego release.
- 8,692 Views

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Great article, somewhat helpful. However on the business rule, it lost the images, what table are you making the business rule for? the notifications, or email template or email layout?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi JC,
This article was really great!! But I'm looking for the business rule part same as wollman, as we lost Images attached. Can you update it, so that it will help me along with others.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello Wollman,
You need to write a before insert Business Rule on the sys_email table.So that it will populate the body of the email in the Inbox with the Email Layout.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello Wollman,
You need to write a before insert Business Rule on the sys_email table.So that it will populate the body of the email in the Inbox with the Email Layout.


- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
hello - the two images above should be visible.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
The images for the BR setup is on the article, I updated the text part to clearly mention the BR setup needed. Hope this helps.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
This article really helped me alot. I was trying to figure out a way to globally apply the company logo to all emails that is sent out from ServiceNow, however I had no clue how to apply the standard email layout to the scheduled email of reports.
I used the above business rule logic, however I made a small change. Instead of trigger condition "Body contains email layout" I used the condition "Target table is sysauto_report", so I skip the step of adding the text "[use: email layout]" to all scheduled email reports.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @JC S_ and @Sruthi17, I changed my code to below:
Changed table for GlideRecord for some reasons
Did the same what @Sruthi17 did for sysauto_report in Business rule so I can skip the step of adding the text "[use: email layout]"
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord("sysevent_email_action");
if(gr.get("sys_id", "9ca09a8cc3986a10e3cfbe13e4013176")) {
var layout = gr.message_html;
}
// Generate the new body content
var mybody = layout.replace('${notification:body}', current.body);
// Append the new content to the existing body
current.body = current.body + "\n" + mybody;
})(current, previous);
I want the signature first and Ref: number after the signature at the end of the email.