Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to apply a background image to email template

BiancaKerchhoff
Tera Expert

Good Day Everyone 

 

I am trying to add a background -image to the OOTB email template. Any advise on how to achieve this?

 

Thanks

3 REPLIES 3

Harsh_Deep
Giga Sage
Giga Sage

Hello @BiancaKerchhoff 

 

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.👍

 

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

Hello @BiancaKerchhoff 

 

Can you please share codes or screenshot, then I can able to help you out.