Survey notification image and link direct to incident survey

cw82uk
Mega Expert

Hi,

I am looking at adding an image to the notification users receive when being asked to complete a survey and also when that image is clicked to take them direct to the survey relating to the incident they received the notification for.

Up to now my mail script is :

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {

template.print('<a href="https://{instancename}.service-now.com/sp?id=my_surveys"><<img src="EXE%20Smiley.png" width="434" height="105"/></a>');

})(current, template, email, email_action, event);

This prints the image EXE%20Smiley.png and takes the user to the url ending /sp?id=my_surveys which shows all surveys,  but my customer wants it to take them direct to the survey relating to the incident they received the notification for.

Our notification prior to using an image had a link which took the user direct to the survey relating to the incident they received the notification for and that used the code below :

<div style='text-align: left; font-weight: bold; padding-left: 90px; font-size:9pt; font-family: Arial'> <mail_script>
var link = new AssessmentUtils().getAssessmentInstanceURL(current.sys_id);
var url = '<a href="' + link + '">' + link + '</a>';
template.print('<a href="' + link + '">' + 'Provide feedback about your IT Support Experience'+ '</a>');
</mail_script></div>

Clicking Provide feedback about your IT Support Experience took the user direct to the survey relating to the incident they received the notification for.

How can I incorporate the image into this?

Thanks

2 REPLIES 2

Jyoti Jadhav9
Tera Guru

Hi @cw82uk 

 

Please try the below code in the notification email script and call this email script in your notification. just replace the name of the image in the below code:

Notification Email script:

var link = new AssessmentUtils().getAssessmentInstanceURL(current.sys_id);
/*var url = '<a href="' + link + '">' + link + '</a>';
template.print('<a href="' + link + '">' + 'Provide feedback about your IT Support Experience'+ '</a>');*/
template.print('<a href="' + link + '">' + '<img src="6on.png" width="434" height="105"/></a>');
 

Please hit the like button if my suggestion has helped you in any way.
Please mark correct if my response has solved your query.

 

Thanks & Regards

Jyoti Jadhav

 

RyannW
Tera Contributor

Any update on achieving this? I am attempting the same configuration and have failed to initiate an actual survey instance utilizing an image. I was able to create a survey from the link however it doesn’t function the same in terms of consistency with linking to the specific survey the incident triggered.