- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2013 10:31 PM
Is it possible to retrieve the watermark reference # on the notification through mail_script code? I need to generate a link in the notification that, when clicked, will generate a reply email with the watermark reference # from the original email for the inbound action to work properly.
I cannot use a "mailto:" template for this because the reply email address may not necessarily be instancename@service-now.com. The reply address depends on the user's company. I can build the proper link if I can retrieve what the watermark reference # will be for the notification.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2014 10:55 AM
Found out that you can actually use...
email.watermark
...within some mail_script code to get the watermark.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2015 10:59 AM
Hi Jim,
Could you please share the code snippet for the same, even i am trying to accomplish the same task.
On click of a link , opening a mailto: with watermark in it.
But i am not able to pass the value as it is not getting stored in a variable to pass it further, though it gets printed by using template.print in the original email.
Below is the code i tried..
====
template.print("watermark:"+email.watermark); // --- this code prints the watermark correctly in the email body
var watermark = email.watermark;
template.print(watermark); //---this code prints 'undefined'
var email = "xyz@xyz.com";
var subject = "Feedback&body=Thanks for the feedback.This is an autogenerated email"
var url1 = '<a href="mailto:'+email+'?subject='+subject+watermark'">'+'<img src="emoticon_angry.png" />'+'</a>'; //-- prints undefined for the watermark part in the mail popup
template.print(url1);
====

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2015 11:38 AM
Hi Ashwani,
Here is a code sample that is similar to what I used in the email notification. The actual code contains proprietary information from my client, so for obvious reasons I can't include it here.
<mail_script>
template.print('<center style="color:#ffffff;"><span class="btn-success"><a href="mailto:' + gs.getProperty("instance_name") + '@service-now.com?subject=Re: Scrum Testing Task - passed (' + email.watermark + ')&body=Please provide any details for Scrum Testing Task ' + gr.number + ' in the body of your email." style="border-color:#009341; background-color:#009341;">Pass</a></span></center>' + '\n');
</mail_script>
I assume you wrapped the code you're using inside a set of mail_script xml tags. I haven't tried getting the watermark from an email and assigning it to a variable, so I can't comment on why that might not be working for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2016 08:39 AM
James... would you mind sharing your code? I'm trying to do something similar. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2016 01:26 PM
Hi Kim,
Please refer to my earlier reply in this thread to Ashwani S, in which I shared a code snippet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-30-2020 04:30 AM
Hi,
Can you please help me with the inputs, I am having same requirement.