Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Question on email notification button link

Mani60
Tera Contributor

Hi There,

 

I have one Requirement on Email Notification,

 

When Request gets closed at that time Requestor will receive one closed Notification, AND that notification Should Contain one Survey to be filled by requestor,

 

For Survey URL i have written one Email Script and called that Email Script in Notification, and when Requestor Receive the Closed Notification in that Survey URL is Coming But the Button "Click here to take the survey", the button is not Coming.

Please find the below Email Script i have Written:

 

template.print('<p><font size="3" color="#000000" face="Calibri (Body)">');

template.print('</font></p>');

template.print('<p><font face="Calibri (Body)">');

    var link = new

global.AssessmentUtils().getAssessmentInstanceURL(current.sys_id);

 var url = '<a href="' + link + '">' + link + '</a>';

template.print('<a style="font-size: 16px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; background-color: #278efc; border: 1px solid #0368d4; display: inline-block; padding: 5px" + href= ' + url + '>Click here to take the survey </a>' );

template.print('</font></p>');

 

 

When Requestor gets Notification, at that time in Email, the button is not Coming:

 

Can Somebody Please help me, how to get The Button(When Requestor Clicks on that button it should redirect to Portal, to take Survey).

 

Thanks,

1 REPLY 1

Peter Bodelier
Giga Sage

Hi @Mani60 

 

You're printing to links. Try this:

 

var link = new global.AssessmentUtils().getAssessmentInstanceURL(current.sys_id);
 var url = 'href="' + link + '"';
template.print('<p><font face="Calibri (Body)"><a style="font-size: 16px; font-family: Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; border-radius: 3px; -webkit-border-radius: 3px; -moz-border-radius: 3px; background-color: #278efc; border: 1px solid #0368d4; display: inline-block; padding: 5px"' + url + '>Click here to take the survey </a></font></p>' );

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.