- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 09:39 AM
Hi All,
I have a requirement where I need to add a background image to the custom notification. Can any one suggest how to achieve this?
Thanks in advance.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 09:48 AM
Hi Sanga,
Description
How to add Background image (which is saved in db_image table) to the Notification template via background attribute without using TAG img option.
Release or Environment
Rome
Cause
When customer attaches background image via attribute it doesn't reflect in the Email
- Image populated in the email body background with the below code in a Notification script
template.print("<Style> body {background-image:URL('imagename.jpg');} </Style>");
- Notification preview and preview html from sent email looks good but when the image in the background is missing when the users receive the email
Resolution
We need to use the code directly in the Message HTML field instead of using in the Notification scripts.
We need to make sure we are giving the complete URL of the image in the code
Sample code to add the attribute in the HTML field
<Style> body {background-image:URL('https://<instancename>.servicenow.com/imagename.jpg');} </Style>
This will help reflecting the background image for the Notification and can be seen in Preview and in Email clients as well.
Reference : Add Background image in email notifications
Mark Correct or Helpful if it helps.
***Mark Correct or Helpful if it helps.***

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 09:48 AM
Hi Sanga,
Description
How to add Background image (which is saved in db_image table) to the Notification template via background attribute without using TAG img option.
Release or Environment
Rome
Cause
When customer attaches background image via attribute it doesn't reflect in the Email
- Image populated in the email body background with the below code in a Notification script
template.print("<Style> body {background-image:URL('imagename.jpg');} </Style>");
- Notification preview and preview html from sent email looks good but when the image in the background is missing when the users receive the email
Resolution
We need to use the code directly in the Message HTML field instead of using in the Notification scripts.
We need to make sure we are giving the complete URL of the image in the code
Sample code to add the attribute in the HTML field
<Style> body {background-image:URL('https://<instancename>.servicenow.com/imagename.jpg');} </Style>
This will help reflecting the background image for the Notification and can be seen in Preview and in Email clients as well.
Reference : Add Background image in email notifications
Mark Correct or Helpful if it helps.
***Mark Correct or Helpful if it helps.***