Service Email Usage – Approval Flow
In this blog article, we will see how we can notify the approval process through email and how to process the action through incoming email. This will be our second use case.
As a recap, below are the four use cases. I recommend visiting the posts in the following order to be on the same line.
- Create a case with the data from the incoming email
- Use approval actions in the assignment notification, to update case automatically from the email service. This use case will use Subject data to identify the corresponding case ID
- Manage email conversations with the case. This use case will showcase how to use Message ID header to identify the corresponding case ID
- Handle delivery status notification messages. This use case will showcase, how we can use Thread-Topic field to identify the corresponding Case ID
It is also recommended to visit another blog article on email account –
Business scenario: Organization AAA which provides electronic repair service is using pega application for servicing the customer. If the spare parts amount exceeds a certain range, say $400 then an assignment is created for the Auditor to approve. Once approved the case continues to the next stage else the case will be resolved. In this scenario, Auditor will be provided access to pega application. Once a case requires approval, it will be routed to his name and he can approve the assignment from his list. The auditor will not be in pega portal 24 hours. Here we can make use of the assignment notification to send out an outbound email so that the approval action can be carried out through email?
To implement this we need to concentrate on 2 areas
- Outbound email β the email body with the approval actions.
- Inbound email β Once, approved or rejected, an incoming email will be coming to Pega. We need an email listener to process the incoming email
First, letβs do the configuration to send the outbound email from the assignment shape.
Configure outbound email
Step 1: Open your case and add the approval / Reject step.
I have routed the assignment an operator ID and enabled the email approval action. Assume Aarti stands for Auditor in this use case.
On clicking the email template you will see the default correspondence template. You can always override in your case class.
I will use the default corr template for approval actions
Step 2: Make sure the recipient operator rule form is updated with the email address. I already updated my operator ID record (auditor operator ID).
Step 3: Make an additional configuration that when rejected, the case should be resolved-rejected.
Step 4: Check if the email account test connectivity works fine.
Note: Make sure you enter a valid reply to β email address. This email address will be monitored by the email listener.
Create a new case.
I have created S-228
You can always click and open the mail from attachments.
Step 5: You should receive the mail in your inbox.
How simple and cool right π
Step 6: I am going to test the negative flow. Click on Reject option.
Make note of the email subject with encoded / junk characters. The email subject is key to determine the corresponding case and approval process identification.
Configure inbound email
Step 1: We will use the same service email and same service activity. Before sending (step 6) the mail, make sure you removed the parameters for the service activity. The parameters are needed only when you want to create a new case. Save the rule.
Step 2: Trace open the service email rule and then send the email.
Now you see the long activity β pyCreateAndManageWorkFromEmail got executed.
Time to explore few activity steps
1. Step 3 and step 4 β decode the email subject ( we saw the junk characters before). Actually, the class of the case and the assignment details got encoded. The step retrieves the class and work ID prefix.
2. Step 16 β Opens the corresponding case.
3. Step 17.1 & 44β email attachment is added with the case.
4. Step 39 to 45 – An instance is queued to a standard agent β ProcessEmailRequest
Okay fine.
Now letβs check the case. Open the case S-228.
Note: Make sure the agent ProcessEmailRequest is up and running in your node.
Successful demo!
As a recap on this use case
– As assignment (approval step) can be notified to the workparty or the assignee using outbound email. Standard correspondence template can be used for email body.
– The email recipient can either accept or reject the assignment and send out the reply mail
– An email listener can be used to receive the mail back and process the same using standard OOTB activity.