Survey Script

Irvine
Tera Expert

I'm trying to grab the survey link for a survey I recently created using the email script below.

var html = new AssessmentUtils().getInstanceLinkHTML(current);
if (!!current.metric_type.sample_metric)
    template.print('<p> To take the survey, click the following image: </p>');

template.print(html);

However using this script in the body of the Notification returns "Take me to the Survey" hyperlinked with the survey URL. What is the best way to tweak this so it only links the Survey URL and does not add the "Take me to Survey" portion with the survey URL hyperlinked?
1 ACCEPTED SOLUTION

Irvine
Tera Expert

This did the trick. Pulled it from an existing email script and tweaked it a bit. Could use a little clean up but I can get the Survey URL from this.

(function runMailScript(current, template, email, email_action, event) {

    var link = new AssessmentUtils().getAssessmentInstanceURL(current.sys_id);

    template.print(event.parm2);

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

View solution in original post

1 REPLY 1

Irvine
Tera Expert

This did the trick. Pulled it from an existing email script and tweaked it a bit. Could use a little clean up but I can get the Survey URL from this.

(function runMailScript(current, template, email, email_action, event) {

    var link = new AssessmentUtils().getAssessmentInstanceURL(current.sys_id);

    template.print(event.parm2);

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