Skip to main content
Kinetic Community

Approving or Denying via email link

Occassionally, it may be desired to allow an approver to approve (and possibly deny) a request by clicking a link in an email without requiring any additional information/action from that user. Note that it is impossible to ensure the person clicking the link is the person the mail was sent to if the individual is not required to log in. If the individual is required to login, there will be that additional login step after clicking the link if there is no single sign on or existing session. Another important consideration is the use of/requirement for Reason for Denial text. If you allow automatic denial, you are not requiring comments for a reason for denial.

Usage

This automated processing is done via parameters passed in the URL provided in the email and then using those parameters in page load events to drive the desired actions.

The first component of this is generating the link in the email. This is done by leveraging the link to the approval item (<<CUSTOMER_SURVEY_LINK>>) and then appending the desired parameter (in this example, the value of the appoval question). The link would look like <<CUSTOMER_SURVEY_LINK>>&approve=Approved.

Note that when allowing automatic approval via a link in email, it is highly advisable to make sure all information an approver should look at to make their decision is included in the email, otherwise approvers will be approving (or denying) without fully reviewing the request.

The second component of this is reading the passed parameters in from the URL and taking the desired actions. This is done using the KD.utils.Util.getParameter functionality.

 

Example

Here is example body text for an email that has clickable links for approval and denial. There is a template in the example to be downloaded. Be sure to set the outgoing mailbox on the example template once you've loaded it.

There is a pending request that requires your approval.<br>
<br>
<b><a href='<<CUSTOMER_SURVEY_LINK>>&approve=Approved' >Please click this link to approve the request</a></b>.<br> <br>
<b><a href='<<CUSTOMER_SURVEY_LINK>>&approve=Denied' >Please click this link to deny the request</a></b>.<br>
<br>

How those links are handled is controled in a load event on the inital page of the approval. This is an example for such a custom event that automatically processed both approval and denial:

var approve = KD.utils.Util.getParameter('approve');
if (approve) {
   KD.utils.Action.setQuestionValue('Is this request approved?', approve);
   document.pageQuestionsForm.submit();
}

This is an example for such an event that automatically submits an approval, but only submits if the value passed was "Approved" so the approver can enter a "Reason for Denial" if the value passed was "Denied". The changes for the "Is this request approved?" question is fired, because this is generally what shows the "Reason for Denial" question.

var approve = KD.utils.Util.getParameter('approve');
if (approve) {
   KD.utils.Action.setQuestionValue('Is this request approved?', approve);
   var ApprElem = KD.utils.Util.getQuestionInput('Is this request approved?');
   KD.utils.Action._fireChange(ApprElem);
   if (approve == "Approved") document.pageQuestionsForm.submit();
}

An example message template and approval item that allows for automated approval and denial (Reason for Denial isn't required) is attached. The attached example uses the klean theme, you may need to update the jsp to your desired display jsp.