Logo
  • Products
    • SecOps Studio
  • Solutions
    • Pega Stack Shifter
  • Services
    • Pega Enablement
    • Pega Modernization
  • About
  • Contact
  • Blog
Code Vault

Service Email Usage – Case Creation

December 10, 2024 Code Vault Curators

In the previous articles, we explored how to create a file listener, an email account, and a service email using the Email Wizard and this article we will create a new case using Service Email

The fundamental processing logic for all listeners in Pega is consistent: the listener monitors a specific location for a message, file, or email and invokes a service rule for processing.

Similarly, in email processing, the listener monitors a specific folder. When an email arrives, the listener invokes a Service Email rule to handle the message. In essence, the Service Email rule is the heart of email processing in Pega.

By leveraging email services, you can perform virtually any type of processing. Since you are utilizing a service activity, you have the full power of Pega activities at your disposal.

In real-world scenarios, most use cases occur at the case level – specifically, either creating a new case or updating an existing one.

  1. Create Case: This is a straightforward process where you use the data from an incoming email to generate a specific case type.
  2. Update a Case / Manage Conversations: This is the most common email use case in Pega. To update a case, the system must first identify the unique Case ID. This requires the sender to indicate which case the email corresponds to a process often referred to as “supporting email conversations.”

I will be splitting the Service Email series into four distinct use cases:

  1. Creating a case using data from an incoming email.
  2. Using approval actions in assignment notifications to update cases automatically. This use case utilizes Subject line data to identify the corresponding Case ID.
  3. Managing email conversations within a case. This will showcase how to use the Message-ID header to identify the correct Case ID.
  4. Handling Delivery Status Notification (DSN) messages. This will demonstrate how to use the Thread-Topic field to identify the corresponding Case ID.

By the end of these four articles, you will have mastered the nuances of Pega email servicing. First, let’s explore the configurations for the first use case.

How to Create a New Service Email Rule

  1. Creation via the Email Wizard
  2. Manual Creation

Enjoying this content?

Access the author’s full video courses here at MyKnowAcademy.

Explore Courses →
Author

Records -> Integration Services -> Service Email -> New

Rather than explaining every field – many of which share configurations with other service rules, I will focus on the Service Email rule created in my previous post.

The rule form contains three primary tabs:

  1. Service tab: Used to specify the Primary Page and the Service Activity name.
  2. Request tab: Handles data mapping from the email to Pega.
  3. Response tab: Configures the automated reply sent back to the sender.
Request Tab

The Request tab is responsible for parsing and mapping email content into Pega properties. The Email Wizard automatically populates three key blocks:

a) Message Header: In this block, email headers (To, CC, Subject, From, etc.) are mapped to Pega properties. By default, there are five mapping fields.

Keep in mind that the Pega engine maintains control over email service request mapping. If you need to map additional headers, simply add a new row and use the down arrow to view available fields.

Note: This dropdown is not limited, you can always add your other message headers that are supported by email providers

b) Delivery Status Notification (DSN) Data: We will explore this in the fourth use case; for now, it can remain empty.

c) Message Data: This maps the entire email body to the Pega property .pyBody.

Note: There is no “Add Row” option in the Message Data section because the entire body is mapped as a single entity.

Important note: Pega utilizes a predefined data model for this mapping. All properties follow the structure: .pyInboundEmail.<Property>

Response Tab

The Service Email response typically involves sending a confirmation email back to the original sender.

You can configure different response templates based on processing conditions. For example, you might send an acknowledgement for successful processing and a different template for errors.

Expand the Message Contents section to see the configuration options.

Pega offers various options to create these templates, with Correspondence rules being the ideal choice. While the Wizard prefills this tab, you can always override the settings to suit your needs.

For this first use case, no additional external configuration was required beyond the listener and email account set up in the previous post.

Testing Use Case 1

Step 1: Save the Service Email rule with the default configurations.

Step 2: Open the Tracer and initiate a trace on the Service Email rule.

Step 3: Since the listener is configured for a specific email ID, I will send a test email from my personal account as if I were a customer.

Step 4: The Tracer confirms successful processing. Inspecting the Service Page on the Clipboard reveals that the Subject and Body mapped correctly to the designated properties.

Step 5: A new case has been successfully created.

Note that the email body was mapped to the case’s short description. You can easily customize this mapping to suit your requirements. The email subject, body, and “From” address are usually the most critical data points for case processing.

Core Activities in Case Creation

1. pyCreateAndManageWorkFromEmail

This is a comprehensive 51-step activity. I will break this down in detail across future use cases, but for now, let’s look at the final step.

2. CreateWorkFromEmail

Here, you can see pyLabel and pyDescription are mapped from the email subject and body. Values set on the Primary Page are eventually merged into the case’s pyWorkPage.

Since these are standard rules, you can customize them or create a wrapper activity to extend the functionality.

In this scenario, the conversation was initiated by an external party. As soon as an email is received, Pega uses the content to drive case processing. Stay tuned for our next article, where we will look at conversations initiated from within Pega!

  • email-processing
Code Vault Curators

A technical team dedicated to empowering the Pega ecosystem with in-depth knowledge, guided by Premkumar Ganesan's vision.

Post navigation

Previous
Next

Pega Courses

Pega courses can be accessed at https://myknowacademy.com

Search through the blog

Tags

activity authentication background-processing case-management data-model declarative-processing email-processing file-processing pega-core-concepts pega-integration process reporting security system-administration user-interface validation

Categories

  • Career
  • Code Vault
  • Insight

Recent posts

  • Career Advice for Pega Developers – Upskilling in 2026
  • Standard Queue Processing Vs Dedicated Queue Processing in Pega
  • Pega LSA Exam Format is changing again with Infinity ’25
  • Pega Blueprint: Top 10 Features That Shaped Its Evolution
  • Different Applications in Pega: Components, Component Applications and Modules

Related Articles

Code Vault

Sending Outbound Emails from Pega

March 2, 2026 Editorial Team

In this blog article, we will see how we can send an outbound email from a Pega application. This is the continuation of the previous blog article, where we created an Microsoft Graph Email Account in Pega Requirement: As soon as a new Mortgage request is created, the case manager should be notified about the […]

Code Vault

Service Email Usage – Handle DSN

December 10, 2024 Code Vault Curators

In this final installment of our series, we will explore how to manage Delivery Status Notification (DSN) messages within Pega. Note: This article was developed using Pega 7.4. While specific configurations may vary in newer versions, the fundamental concepts remain applicable. Series Roadmap To fully grasp the progression of Pega email integration, consider reviewing the […]

Code Vault

Service Email Usage – Manage Conversations

December 10, 2024 Code Vault Curators

In this blog article, we will explore our third use case: Managing Email Conversations within Pega using Service Email Note: This article was created using Pega 7.4. While configurations may differ in more recent versions, the core concepts remain the same. Series Recap To get the most out of this series, I recommend visiting these […]

Code Vault

Service Email Usage – Approval Flow

December 10, 2024 Code Vault Curators

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 […]

About

MyKnowTech was born with a mission to bridge the gap between technical expertise and business needs. We are a boutique firm specializing in Pega solutions, delivering them with a personal touch. At the heart of our philosophy is a commitment to putting clients first.

Company
  • About
  • Leadership
  • Career
  • Contact
Resources
  • Blog
  • Services
  • Solutions
  • Insights

©  MyKnowTech B.V. All Rights Reserved.

  • Sitemap
  • Terms & Conditions
  • Privacy Policy