Add hyperlink to email notification template

richardhofing
Mega Expert

I currently have an email template that currently generates this: 

Please click here in order to approve or reject this request LINK S'il vous plait cliquez ici afin d'approuver ou rejeter cette requête.

The user clicks on the LINK and it takes them to the record. This is working fine. However, I would like to change it so that the words "click here" and "cliquez ici" are hyperlinks that go to the same destination as LINK (and I will remove LINK). The LINK is a ${URI_REF}, as shown below:

Please click here in order to approve or reject this request ${URI_REF} S'il vous plait cliquez ici afin d'approuver ou rejeter cette requête.

This is the goal:

Please click here in order to approve or reject this request / S'il vous plait cliquez ici afin d'approuver ou rejeter cette requête.

 

 

4 REPLIES 4

Harsh Vardhan
Giga Patron

by using mail script you can solve it.

 

adding link here kindly check that.

https://www.servicenowguru.com/system-definition/email-notifications-system-definition/email-links-u...

Alikutty A
Tera Sage

Hello,

You could make use of notification email scripts and messages to set this up.

1) Create 4 different messages for both the languages

Message name: Click here

a) click here

b) cliquez ici

Message name: Link text

c) Please {0} in order to approve or reject this request

d) S'il vous plait {0} afin d'approuver ou rejeter cette requête.

 

2) Create the following notification email script: generate_link

var tbl = current.getTableName();
var sysID = current.sys_id;
var link = createLinkForObject(tbl,sysID);

template.print(gs.getMessage('Link text', link));

 

function createLinkForObject(strTableName, strSysID){
   return '<a href="' + gs.getProperty('glide.servlet.uri') + gs.generateURL(strTableName, strSysID) + '">gs.getMessage('Click here')</a>';
}

3) Include this mail script in your notification HTML body

{mail_script:generate_link}

Please try it and let me know

 

Thanks!

Hello,

Have you tried this out?

you mean the push notification messages and sys email scripts?