Link in email notification not working

Cupcake
Mega Guru

I am trying to include a link in my email notification that will open the current approval record. This script is inside of a mail script.

'<a href="/ess?id=approval&view=ess&table=sysapproval_approver&sys_id='+current.getUniqueValue() + '">${current.sysapproval.number}</a>'

I've tried adding the link directly or adding the mail script but neither way is working:

 

a. Adding the link directly

Please click the link to  Approve or Reject the request: '<a href="/ess?id=approval&view=ess&table=sysapproval_approver&sys_id='+current.getUniqueValue() + '">${current.sysapproval.number}</a>'

 

b. Adding the mail script

Please click the link to  Approve or Reject the request: ${mail script:ess_approval_link_revised}

Any idea why this is not working.

 

1 ACCEPTED SOLUTION

Try this in mail script , below code is not tested, please verify if it satisfies your requirement 

    var gr = new GlideRecord('sysapproval_approver');
    gr.addQuery('sysapproval',current.sys_id);
     gr.addQuery('state','requested');
    gr.query();
    if (gr.next()) {
        template.print('<a href='+gs.getProperty('glide.servlet.uri')+'/ess?id=approval&view=ess&table=sysapproval_approver&sys_id='
+ gr.getUniqueValue() + '>' + gr.sysapproval.number + '</a>');
}
   

View solution in original post

7 REPLIES 7

VigneshMC
Mega Sage

Try adding this in your mail script

template.print('<a href='+gs.getProperty('glide.servlet.uri')+'/ess?id=approval&view=ess&table=sysapproval_approver&sys_id='
+ current.getUniqueValue() + '>' + current.sysapproval.number + '</a>');

Thanks

Thank you for replying. I am getting the following:

 

find_real_file.png

 

find_real_file.png

 

 

looks like you are running this on workflow, on which table the workflow is running on

The request item table.

Thank you again for replying so quickly.

Karen