- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 07:35 AM
Hey all,
How to add a hyperlink in an email body that is to be sent as a notification:
my email body should look like:
Please click Manager dashboard to check for the pending work.
The Manager dashboard I need to show as a hyperlink, and obviously this codes is gonna be moved to prod instance, so I need the current instance name to be appended there in the hyperlink.
The URL of manager dashboard looks something like this:
https://abcdev.service-now.com/nav_to.do?uri=%2F$pa_dashboard.do%3Fdashboard%3D4ddcdbd59393220064f572edb67ffbd4
Please let me know how would I achieve this. I am trying to put that as gs.getProperty(Instance_name) in the email sctipt but doesn't work.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 08:10 AM
What is the result you are currently getting?
You should probably add "https://" to the start of the href attribute as well, but I doubt that's the issue.
I'm guessing it might be an issue with the single/double quotes. Change the double-quotes surrounding "instance_name" with single-quotes and remove the quotes around "Pending Approval". And you have an extra double quote just before
".service-now.com" that should be removed.
Try the following:
template.print('<a href="https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=/$pa_dashboard.do%3Fdashboard%3Dc0a5b3d99353220064f572edb67ffb40">Pending Approval</a>');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 07:46 AM
I think we can use <a> tag in notification body
<a href=''''>Manager dashboard</a>
Mark as helpful or correct based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 07:52 AM
Yes that is what I want to know how would put it in the a href tag. Basically the syntax. And it should take the current instance name.
I am putting like:
template.print('<a href="'+gs.getProperty("instance_name") +' ".service-now.com/nav_to.do?uri=%2F$pa_dashboard.do%3Fdashboard%3Dc0a5b3d99353220064f572edb67ffb40">"Pending Approval"</a>');
Please correct me where it is wrong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2018 08:10 AM
What is the result you are currently getting?
You should probably add "https://" to the start of the href attribute as well, but I doubt that's the issue.
I'm guessing it might be an issue with the single/double quotes. Change the double-quotes surrounding "instance_name" with single-quotes and remove the quotes around "Pending Approval". And you have an extra double quote just before
".service-now.com" that should be removed.
Try the following:
template.print('<a href="https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=/$pa_dashboard.do%3Fdashboard%3Dc0a5b3d99353220064f572edb67ffb40">Pending Approval</a>');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2018 01:53 AM
Yeah I had done the same and it worked. Thanks for the reply.