RITM still waiting for approuval after approuve/reject buttons

imhicham
Tera Contributor

Hi all ;

i have two buttons on an email template , it's working good but the issue is the RITM still waiting for approuval maybe you clic on approuve or reject buttons : 

 

imhicham_0-1707131008789.png

 

sharing the the email script for two buttons : 

 

//email.button.approve.insert

var img = "/approve.png";

var response = "approve";

var emailbod = "I approve this request.";

template.print(renderMailtoButton(img, response, emailbod));

 

*******************************************************************

 


var img = "/reject.png";

var response = "reject";

var emailbod = "I reject this request.";

template.print(renderMailtoButton(img, response, emailbod));

 

*********************************************************************

 

Script includes : 

****************

 

function renderMailtoButton(image, response, emailbod){

var instance = gs.getProperty("instance_name");
var link = "https://" + instance + ".service-now.com";
var mark = email.watermark;
var number = current.number;
var emailAddress = instance + "@service-now.com";
if (current.getTableName().indexOf("sysapproval") != -1){
number = current.sysapproval.number;
}
var mailLink = '<a href="mailto:'+ emailAddress + '?subject=Re:' + number + ' ' + response +'&body=' + emailbod + mark + '"><img src="' + link + image + '"></a>';
return mailLink;

2 REPLIES 2

Amit Verma
Kilo Patron
Kilo Patron

Hi @imhicham 

 

On Click of the buttons, you will be prompted to send a mail to the ServiceNow instance to either approve or reject the record. Are you sending that response ?

 

Refer this article and debug https://www.servicenow.com/community/itsm-blog/approve-reject-button-in-approval-notification/ba-p/2...

 

Thanks & Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

yes i reply, i click on send but then , nothing it's approuved