How to apply a background image to email template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 09:32 AM
Good Day Everyone
I am trying to add a background -image to the OOTB email template. Any advise on how to achieve this?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 10:10 AM
Hello @BiancaK
Try to use these 2 way around-
1. 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.
2.
Include in HTML Email Body : <Style> body {background-image:URL('https://<instance-name>.servicenow.com/banner-img.jpg');} </Style>
Include in Email Script : Template.Print("<Style> body {background-image:URL('https://<instance-name>.servicenow.com/banner-img.jpg');} </Style>");
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.👍
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 10:22 AM - edited 10-17-2023 10:33 AM
Hi @Harsh_Deep
I tried this already it does not work. I used the servicenow doc: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1117059
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2023 10:35 AM