Notification URI_REF links redirect to Employee center
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 11:10 AM
in our email notifications , we would like to redirect the notification Uri link to to employee center portal , when user click on the link it should redirect to portal instead native UI
Here is the below code. can someone please assist us.
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var result = new ActivityMentionEmailValues().getEmailValues(current.table, current.document);
if (result) {
result = JSON.parse(result);
email.setSubject(gs.getMessage("You have been mentioned in {0}", result.subjectText));
template.print("<p style='color: #424E5B;margin: 0 0 12px;line-height: 26px;margin-bottom: 12px'>");
template.print(gs.getMessage("You have been mentioned by {0} in", current.user_from.name));
template.print(" <a href='/nav_to.do?uri=" + result.className + ".do?sys_id=" + result.recordSysId + "'>" + result.linkText + "</a></p>");
}
})(current, template, email, email_action, event);
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 11:37 AM
Hi @mravulakolu
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var result = new ActivityMentionEmailValues().getEmailValues(current.table, current.document);
if (result) {
result = JSON.parse(result);
email.setSubject(gs.getMessage("You have been mentioned in {0}", result.subjectText));
template.print("<p style='color: #424E5B;margin: 0 0 12px;line-height: 26px;margin-bottom: 12px'>");
template.print(gs.getMessage("You have been mentioned by {0} in", current.user_from.name));
var portal ='esc' //replace with any other portal
var url = gs.getProperty('glide.servlet.uri') + portal + '?id=form&table=' + result.className + '&sys_id=' + result.recordSysId;
template.print("<a href='" + url + "'>" + result.linkText + "</a></p>");
}
})(current, template, email, email_action, event);
try this
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2025 11:47 AM
Hello @mravulakolu ,
Please replace the last line with this:
template.print(gs.getMessage(
'<a href="/esc?id=ticket&table={0}&sys_id={1}">{2}</a></p>',
[result.className, result.recordSysId, result.linkText]));
If you want the full form to open replace "ticket" with "form.
Regards,
Robert