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

coolboy
Mega Expert

Try some thing like this



<img src=""<mail_script>template.print(gs.getProperty('glide.servlet.uri'))</mail_script>PleaseReadBanner.gifx""></img>


It works now. Thanks a lot! 🙂


Quyen1
Tera Contributor

The logo not showing up for me either. Please share how you resolved the issue?

Thanks
Quyen


JayaBharathi
Kilo Contributor

did u succeed in bringing the image on oulook ? like, it is working fine for me, but until i click on 'download pictures' in my outlook, i am not able to see the image.