Approve/Reject Button in a Notification

AP30
Tera Expert

Hello,

I have a requirement to configure Approve and Reject button in an email notification for Change. What is the best process to have this configured on the email notification instead of having a text for approve/reject?

Thanks for your help.

10 REPLIES 10

Hi Tim,

 

When you create a Script include you will have something populated automatically in the Script area. You can remove it & copy the script as mentioned in my post before as is.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

I tried it and updated the email script as well but same issue

var img = "/approve.png"; //considering approve.png is the image stored in Image table of ServiceNow

var response = "approve";

var emailbod = "I approve this request.%0D%0A%0D%0A";

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

 

What can i possibly be missing? Thanks

Hi Tim,

 

Can you kindly paste the scripts written for getting this in place once.

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

I have indicated existing script in the thread

Below is the current script that works in dev instance but not in Prod. Anyway you can tell what might be wrong?

var link = "mailto:"+gs.getProperty('instance_name')+"@service-now.com?subject=Re:"+current.sysapproval.getDisplayValue()+" -approve&body="+email.watermark;


template.print('<font face="helvetica">');

var backgroundColor = 'background-color: #006400;';
var border = 'border: 1px solid #000000;';
var color = 'color: #ffffff;';
var fontSize = 'font-size: 16px;';
var fontFamily = 'font-family: Helvetica, Arial, sans-serif;';
var textDecoration = 'text-decoration: none; border-radius: 3px;';
var webKitBorder = '-webkit-border-radius: 3px;';
var mozBorder = '-moz-border-radius: 3px;';
var display = 'display: inline-block;';
var padding = 'padding: 5px;';

template.print('<a href="' + link + '"');
template.print('style="' + backgroundColor + border + color + fontSize + fontFamily + textDecoration + webKitBorder + mozBorder + display + padding);
template.print('">');
template.print(gs.getMessage('Approve'));
template.print('</a>');
template.print('</font>');
})(current, template, email, email_action, event);