I need to add Background image to custom notification

sanga2
Tera Contributor

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.

1 ACCEPTED SOLUTION

Yousaf
Giga Sage

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

View solution in original post

1 REPLY 1

Yousaf
Giga Sage

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