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

Adding a url in notification to direct user to portal (front end)

Charles Hong
Mega Expert

Hello -

Currently within an notification i use "${URI_REF}" which becomes an hyperlink to a Knowledge article record on the back-end. Where then a user has to scroll down under related links to click view article.

Is there a code that i can put in the notification where the user will be redirected to that knowledge article on the front end (portal) or on the back end but to the actual article where user can see published article?

anything helps, thanks.

5 REPLIES 5

Lakshmaiah Dump
Giga Expert

Hi,



You can write the Notification Email Scripts and use in the Notification script by calling   ${mail_script:portal_link}



Note : No space bw mail_script:portal_link



Mail script name is portal_link


(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,


                  /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,


                  /* Optional GlideRecord */ event) {


template.print('<a href="http://www.google.com">link</a>');




})(current, template, email, email_action, event);






For more details please check ServiceNow doc : https://developer.servicenow.com/app.do#!/lp/servicenow_administrator/app_store_learnv2_automatingap...


https://developer.servicenow.com/app.do#!/lp/servicenow_administrator/app_store_learnv2_automatingap...



Hit Correct/ Endorsers/ Helpful/ Like depending on the impact of the response


Lakshmaiah Dumpala


How to call the notification email scripts in notification.



Description: ${description}


Created by: ${sys_created_by}



${mail_script:portal_link}




Hi - i want to make the url direct to the actual specific knowledge article from a portal view. Not just redirect to my instance. is that possible?


Hi,



Yes. That will work for you like. Directly open service portal view.



We have actually Servicenow instance https://dev.service-now.com/



Self Service Portal https://dev.service-now.com/sp



Add more in details steps how you would like to be.



Hit Correct/ Endorsers/ Helpful/ Like depending on the impact of the response


Lakshmaiah Dumpala