Change Approval via email

Community Alums
Not applicable

Hi All,

How can i send a reply mail to the approver if the group approval is already done?

Let me elaborate, For group approval, if one person approves, rest all group related approval records set to No Longer Required. In this situation, if another member from the same group tries to approve, i want the system to send a response saying this change is already approved by XYG of your group.

Right now, the No Longer Required change is set to Approved if the second member tries to approve.

3 REPLIES 3

jnovack
Kilo Guru

Why would you only want to reply to the single person only if they sent the response? A "thanks, but no thanks, you were too slow."



If you want notifications on approvals, you may wish to consider replying to the entire group saying someone beat you to it and already responded.   Which would be a Workflow modification.



However, in your case, you may want to put a business rule on the group approval table that runs before update to see if the entry is "no longer required".   If so, fire off an event.   Within email notifications, create a notification triggered by the event firing.


Community Alums
Not applicable

HI Justin,



Thanks for the response! I see one base line Inbound Email action "Update Approval Request" which sends different notifications and process the incoming approval/reject emails. Any idea how we can achieve my above requirement via this email action.


Bear in mind, I'm still a SNOW virgin, but if you were insistent upon updating the Update Approval Request script, you can do so somewhere in the logic.



Near the check for current.state == 'cancelled', I would add logic to check to see if the state is "No Longer Requested".   Then you can use the already existing createEmailEvent() function defined to send your "Sod off, slowpoke. Someone else already approved it." message.



If you want "Someone else" to actually list who approved it, then you'll have to use the "approval for" to query the sysapproval_approver table and state = approved to get the user (don't forget to getDisplayName a reference) who approved it.



All in all, it's about 5-15 lines of code depending on if you want "Someone Else" to say "Fred Luddy" instead.