How To Create Button in Email Notification Using Email Script

Community Alums
Not applicable

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:
 
PriyaSm_0-1699340903851.png

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,

 

 

 

3 REPLIES 3

Samaksh Wani
Giga Sage

Hello @Community Alums 

 

Modify the script :-

 

Added some single and double inverted commas.

 

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>' );

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

 

Community Alums
Not applicable

Hello @Samaksh Wani ,

 

Thanks for your response.

 

When i change the code as per you mentioned, i'm getting an error in code, please find the below snap attached.

PriyaSm_0-1699348773126.png

 

Please let me know, what changes i should do

 

Thanks,

 

Hello @Community Alums 

 

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>' );