Display hyperlink in the mail html body that fetches a particular record from a table

Hemamani Prabha
Tera Contributor

Hello all,

I need to display a hyperlink in the email notification body and by clicking that link it should navigate to that particular record from the particular table.

 

There are ${sysapproval.u_job_role} users on the role ${mail_script:sc_req_item_options_job_role}, please consider this before approving.

 

In the above,  I need to modify text so it hyperlinks(highlighted in blue) to the exact permission that is asking for the access. It should take me to the particular record on clicking it. How can I achieve this?

Thanks in advance,

Hema

1 ACCEPTED SOLUTION

Hi @Hemamani Prabha 

yes, you need to call the email script in the notification body.

Please find the below syntax 

OmkarKumbhar_0-1698298582393.png

Thanks,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

View solution in original post

6 REPLIES 6

Omkar Kumbhar
Mega Sage
Mega Sage

Hello @Hemamani Prabha ,

In the email script you can add this line of code

 

var link = '<a href="table_name.do?sys_id=' + current.sys_id + '" >Please click to approve the record</a>';

template.print(link);

 

Please click to approve the record - This text will be displayed in blue with link and once it is clicked it will redirect to record

 

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

hi @Omkar Kumbhar 
Thanks for your reply. This helps but I would also like to know where should I link this email script to the message html body part of the notification so that the email contains the hyperlink when it is sent.

Thanks,

Hema

Hi @Hemamani Prabha 

yes, you need to call the email script in the notification body.

Please find the below syntax 

OmkarKumbhar_0-1698298582393.png

Thanks,

Omkar

If I was able to help you with your case, please click the Thumb Icon and mark as Correct.

Hi @Omkar Kumbhar 
The hyperlink is getting displayed, thanks for that but when I click on that click it shows me "no record" as it is not fetching the correct sys id. I need to fetch the record from the table name that is mentioned in the link

current.sys id is not working here.. pls help
var link = '<a href="table_name.do?sys_id=' + current.sys_id + '" >Please click to approve the record</a>';