Service Email Usage – Approval Flow

This second article in our series focuses on a powerful automation feature: Email Approvals. We will explore how to notify users of a pending approval via email and, more importantly, how Pega processes their “Approve” or “Reject” reply to move the case forward automatically using the same Service Email rule.

As a recap, we are navigating through four core use cases. I recommend following them in order to get the complete picture:
- Case Creation: Generate a case from an incoming email.
- Email Approvals: Automate case updates using Subject line data to identify the Case ID. (Current Post)
- Conversation Management: Use Message-ID headers to link replies to cases.
- DSN Handling: Manage delivery failures using the Thread-Topic field.
Business Scenario: Organization AAA, an electronics repair provider, uses Pega to manage service requests. If a spare part cost exceeds $400, the case requires an Auditor’s approval. Since the Auditor isn’t logged into Pega 24/7, we want to send an email notification that allows them to approve or reject the request directly from their mobile device or desktop email client.
To implement this, we must configure two components:
- Outbound Email: The approval request sent from Pega containing action links.
- Inbound Email: The listener that captures the Auditor’s reply and processes the action.
Part 1: Configure Outbound Email
Step 1: Add the Approval Step Open your Case Life Cycle and add an Approve/Reject step. Route this to the Auditor’s operator ID and enable the Email approval option.

Pega provides a default correspondence template for this. While you can override it in your case class, the standard template works perfectly for this use case.

Step 2: Update Operator Records Ensure the Auditor’s Operator ID record has a valid email address. Without this, Pega won’t know where to send the notification.

Step 3: Configure Post-Action Logic In the Approve/Reject step, configure the “If Rejected” path to resolve the case as Resolved-Rejected.

Enjoying this content?
Access the author’s full video courses here at MyKnowAcademy.
Explore Courses →
Step 4: Verify Email Connectivity Check your Email Account rule and run a “Test Connectivity.”
Pro Tip: Ensure the Reply-To address is valid and identical to the one your Email Listener is monitoring.

Step 5: Create a Test Case Create a new case (e.g., S-228). You should see the outbound email appearing in the case attachments and, shortly after, in your personal inbox.


Step 6: Test the Negative Flow Open the email in your inbox and click Reject. You will notice the reply email has a subject line filled with encoded “junk” characters. Do not delete these. This encoded string is the key Pega uses to identify exactly which case and assignment you are responding to.
Important note: This encoded signature in later versions can be found in the email body as well!!

Part 2: Configure Inbound Email
Step 1: Adjust the Service Activity We will use the same Service Email rule from our first use case. However, ensure you remove any parameters from the service activity if you were previously using them for case creation. For updates, the encoded subject handles the identification.

Step 2: Trace and Send Open the Tracer on your Service Email rule and hit “Send” on your reply email. You will see the heavy-duty activity pyCreateAndManageWorkFromEmail spring into action.
Key Activity Steps to Watch:
- Steps 3 & 4: These steps decode that “junk” subject line to retrieve the Case Class and Work ID prefix.
- Step 16: Opens the specific case (S-228) in the background.

- Steps 17.1 & 44: Attaches the reply email to the case for auditing.
- Steps 39 to 45: Queues the request to the standard Pega agent:
ProcessEmailRequest.
Note: For the case to actually advance, the ProcessEmailRequest agent must be running on your node.

The Result
Check case S-228. You will see the status has updated to Resolved-Rejected automatically, and the assignment has been cleared—all without the Auditor ever logging into the Pega portal!

Note: Make sure the agent ProcessEmailRequest is up and running in your node.
Summary of Use Case 2:
- Assignments can trigger outbound emails to work parties using standard correspondence templates.
- Recipients can click simple links to Approve or Reject, sending a reply with a unique encoded subject.
- Listeners use OOTB activities to decode that subject, open the case, and advance the workflow.



