How Can we change link text to "click here" in notifications.

pavan_yakkala
Kilo Contributor

Hello,

I have included CMS link in Notification which redirects me to a public page.

Below is the line included in my Notification Message.

${CMS_URI+armspublic/UserCreation2nSignupPublicPage}

where "armspublic" is my site name and "UserCreation2nSignupPublicPage"

It is displaying as   LINK   in my Email Content.

I have a requirement to change this text "LINK"   to "Click here".

How can we change this?

Can any one help me on this.

Thanks,

Pavan.

1 ACCEPTED SOLUTION

var instanceURL = gs.getProperty("glide.servlet.uri");



  instanceURL = instanceURL + "armspublic/";


  var ui_pagename = 'Your ui page name';


  var cmspage = encodeURIComponent(ui_pagename);


  var url = instanceURL + cmspage+'.do?sysparm_document_key=' +u_user_information+'sys_id='+current.sys_id;




Regards,


Harish.


View solution in original post

11 REPLIES 11

Kalaiarasan Pus
Giga Sage

tried this ?



<a href='${CMS_URI+armspublic/UserCreation2nSignupPublicPage}'> Click Here </a>


Hi kalaiarasan,



Thanks for your reply.



Just i have tried the above link you have specified. but its not helping me.


It is generating URL like


<a href='<a href="https://baservicesdev.service-now.com/armspublic/UserCreation2nSignupPublicPage.do?sysparm_document_...">LINK</a>'> Click Here </a>



Can you please help me on this?



Thanks,


Pavan.


sorry .. i dint notice you had used URI...



build your url using gs.getProperty('glide.servlet.uri')




gs.getProperty('glide.servlet.uri') will give your instance URL... build the rest as per your need


Harish Murikina
Tera Guru

Hi Pavan,



                          Try this below code. It works for me.







Includescript


__________








var GenerateURL = Class.create();


GenerateURL.prototype = Object.extendsObject(AbstractAjaxProcessor, {



  createCustomURL: function(strTableName,strSysID,linktext)


  {



  return '<a href="' + gs.getProperty('glide.servlet.uri') + gs.generateURL(strTableName, strSysID) + '">'+ linktext +'</a>';



  }


});




mailscript


__________




<mail_script>


gs.include('GenerateURL');


var create_link = new GenerateURL();


var tblname = current.getTableName();


var sysID = current.sys_id;


var link_text = 'Click Here';


var link = create_link.createCustomURL(tblname,sysID,link_text );


template.print("<tr><td> For more details regarding this   Incident : "+link+"</td></tr>");


</mail_script>




Regards,


Harish.