Approving requests through email: notifications, Inbound actions, sysapproval_approvers and user tableIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Approving requests through email: notifications, inbound actions and the sysapproval_approvers table. Introduction This article describes the details of the emails and records involved in approving a request. More details about how approvals work and can be configured can be found in the documentation appropriate for your version, for the London version see Approvals . The instance version used for this article is London Patch 4 Hotfix 2. All the records used are Out Of the Box, no modifications were done to inbound actions or notifications. Although the details below refer to the process of ordering an item from the catalog the basics, steps etc are valid for any kind of approval. Notification After an item is ordered a record is created in the sysapproval_approvers table, this table can be found under the 'Approvers' menu item. All approvals (regardless on which table) are recorded in this table. In this case an event (request.approval.inserted) is generated which fires the notification 'Catalog Approval Request'. This will contain 2 html mailto links, so that the recipient can click on the provided links to either approve or reject the request. In the notification and/or template used you will see the following code: <hr/>${mailto:mailto.approval}<hr/>${mailto:mailto.rejection} The following html is generated from the the above code The 'mailto' is responsible for the html mailto link, the content is created in the appropriate 'Email Templates', in this case mailto.approval and mailto.rejection. These come with their own watermark, which point to the approval record, the notification itself will contain a watermark pointing to the record that needs to be approved. The links will create an email addressed to the instance with the appropriate subject: The request number and either the strings 'approve' or 'reject', the body will contain the watermark to ensure the correct record (on sysapproval_approvers) is updated. Please be aware that the <a href=mailto[...]> has its limitations (the body cannot contain html formatted text) For more information on how the mailto href works see this W3schools mailto example. Inbound Action Out of the box the inbound action 'Update Approval Request' is used to process the approval or rejection. As with all inbound actions 2 things are done by default: finding the record in the table based on the watermark and associate the incoming email address to a user record in the instance. The script ensures that only people that have been assigned to approve a request are able to do so. In the function validUser the approver in the approval record matches the user sending the email. If the sender does not match the approver the validUser function also generates an event that will send an email to the sender that the "Sender email does not match approval assignee." and an error message is logged. In the same function it is verified if is a delegate is assigned for this user that can approve requests. For documentation on delegates see Delegate approvals and tasks to another user The inbound action will also generate events depending on the current state of the approval, if the state is canceled the inbound action will generate an event to notify the sender that the approval has been cancelled. Otherwise, depending on the content of the subject of the email ('approve', 'reject') the state of the record will be set (approved or rejected) Logs, errors and debugging As you can see from the inbound action log messages and response emails are generated that will explain why the approval was successful or failed. They first step should be to check the script log statements for messages generated by the inbound action. Failed (can be seen in the related list Email Logs of the email) Success (can be seen in the related list Email Logs of the email) A common mistake is that approvers reply to the incoming email, rather than clicking on one of the links in the email to generate the email. As the outgoing notification has a watermark pointing to the record that needs to be approved rather than the sysapproval_approver table the approval will fail. When the wrong user tries to approve a request A notification event is created and an email is send to the person trying to approve the request. Script Log Statements Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All releases Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Notification and inbound action to fit your requirements If there is a need to modify the notification and/or the inbound action ensure that the original OOB record remains unmodified as this ensure that OOB records are updated through upgrades. The best way to preserve the OOB records is to right-click on the grey top bar and select 'Store/Stay', this will create a duplicate of the record which you can modify to your business needs. The original record can always be used as a reference point. Apart from any other modification you might want to apply (formatting/logo's etc) the 2 most essential parts to ensure that approvals keep working are the following: In the notification mailto link the correct subject should be set. In the inbound action the keywords for approving or rejecting should be updated or the code should be modified to include multiple terms for approval/rejection (approvato e respinto (italian)) and appprove, reject (english) The code for approving could be similar to this: //if (subject.indexOf("approve") >= 0){if (subject.match(/^(approve|approvato|approuver)$/)) { This example should handle approvals in English, Italian and French. Needless to say this should be tested on a dev instance before bringing it over to production.