The CreatorCon Call for Content is officially open! Get started here.

How to send a dynamic image in a notification

sakshi_a
Kilo Explorer

Hi,

I need to send an image (company logo) as a part of email notification. The image is stored at the service-now instance/images location.
Currently the image source is hard coded :
src= instancename/hcl_logo.pngx
such a value needs to be changed for every instance in every notification. To avoid this, I was looking for a way to dynamically set the image location which would work irrespective of the instance name.
I have tried using relative address:
src= "/hcl_logo.pngx"
This seems to work fine on the instance (the notifications display the logo) but the image does not come as a part of MS Outlook message.
I also tried using html script tags, to derive the current location from 'window.location' but that didn't work.
Another dead-end was using 'glide.servlet.uri' as a part of mail_script. The image URL was retrieved successfully, with the notification on instance displaying the logo but again, the image does not come as a part of MS Outlook message.

Please help!
Thanks in advance!

7 REPLIES 7

hi Jaya,

if you use template.print in front of the image path, it displays on outlook as well.


tmwrapelee
Tera Contributor

Sakshi,
I copied the email script above in the message field of the notification , but the company logo (stored as an image) does not show up. Did you add the property glide.servlet.uri to your instance? I could not find it in the System Properties table, although it may be hidden. Any help would be appreciated. Thanks in advance.
theresa


srathore
Kilo Expert

Hi,

I trried your fix to use template.print in front of the image path but that doesnt display the image in Outlook until i choose to download it. Any suggestion what i might be doing wrong?