Approve and Reject Button on email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-28-2020 10:18 PM
Approve/reject button in email
Requirement is to create an email notification having 2 buttons approve and reject .On click of approve button email would be sent to manager that request is approved or Rejected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-28-2023 08:51 AM
Hello,
I have a follow up question to the Approve and Reject button:
Current behavior: We see these two buttons (Approve and Reject) in the email notification. It is taking to replay screen with stand text "Approved", and use have to click Send in the outlook as well.
In other words: User has to do 2 clicks, Approve/Reject and Send buttons to make this happen.
Question: My stakeholders wanted with only one click Approve shall send the email as well (do not have to click Send in the outlook email).
Desired future behavior: user shall click only "Approve"/"Reject" button in the email notification, that shall send the email back to servicenow. Is this possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-28-2020 11:38 PM
Hi Roshani,
Check with the method which i given below.
Create a buttons called approve and reject and call notifications.
-To link notifications with ui actions:
Approved:
gcurrent.setValue('u_status',"approved");
current.update();
gs.eventQueue('Booking Successful',current,"a",gs.getUserName());
Rejected:
gcurrent.setValue('u_status',"Rejected");
current.update();
gs.eventQueue('Booking Rejected',current,"a",gs.getUserName());
-Create an event called "meeting successful" for notification 1(request approved).
-Create an event called "meeting rejected" for notification 2(request rejected).
-create a notification called (request approved,request rejected).
In when to send:
Send when- event is fired
Event name-meeting approval/meeting successful/meeting rejected.
In who will recieve:
Add created group/users.
In what it will contain:
create a message.
-Create a Business Rule to trigger Notification 1.
/*(function executeRule(current, previous /*null when async*/) {
gs.info("hello");
gs.eventQueue('Booking Approved',current,gs.getUser().getEmail());
gs.eventQueue();
})(current, previous);*/
-Create a Business Rule to trigger Notification 2.
/*(function executeRule(current, previous /*null when async*/) {
gs.info("hello");
gs.eventQueue('Booking Rejected',current,gs.getUser().getEmail());
gs.eventQueue();
})(current, previous);*/
If its worthy mark correct and mark as helpful.
Thanks,
Dinesh Kumar G
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-28-2020 11:49 PM
Hello Roshni,
Have you gone through this Article:
Approve/Reject button in notification
Approval / Reject Email and its template along with Button in Email
Please mark as Correct Answer and Helpful, if applicable.
Thank You!
Abhishek Gardade
ServiceNow MVP 2020
Abhishek Gardade