Email Processing using Email Wizard

In this article, we will explore Email processing. In this article, we will see more in detail about the email wizard.
What is email processing?
I will explain this with the popular Customer Service application. Say an insurance company provides email servicing to their customers.
How this servicing can be performed?
In general in 2 ways
1. A customer service agent who keeps on monitoring an email account and as soon as a mail comes in, he responds appropriately
2. Basically, in the above way, the agent behaves like a robot reading and replying (service) to the customers :). So this email servicing can be automated, say robots monitoring the email account and replying appropriately.
Now, let’s come to Pega. Pega has its own set of rules that support email processing in a more automated way.
Email servicing can end up in creating a case, updating a case, executing any operations within pega and also sending out the reply to the customers. Any type of processing is possible in pega email processing.

1. An email account
This will be a unique email address where the customers can seek out help or queries
Note: Email processing not only serves external customers. Within the organization, different departments can communicate using a common mailbox and pega can monitor the mailbox and perform the required operations.
2. An email listener
This component is responsible to automatically monitor an email account, preferably on Inbox and whenever a new email comes in, it triggers the responsible service component to perform the operations.
3. Service Email
This rule is responsible to parse and invoke the responsible service activities.
For the email account, you can visit another blog article –
You can also use any existing email account.
Go to the receiver part and do a test connectivity

You should get status good.
Note: This email account can be created from email wizard as well.
Okay, let’s straightaway start the wizard.
What are the Wizard steps?
Designer studio -> Integration -> Email -> Email wizard

It opens the first step in the wizard
1. Enter email information

What would you like to do? – It provides 2 options
1. Receive an email and create/manage a work object – This is basically to configure the file listener and the email processing part.
2. Configure an email account is to just create an email account.
Select the first option
What are the class and flow name? – Specify the class on which you need to perform the operation.

You can also specify the starting flow name.
Now, you may get a question like, can we do only flow processing in Pega?!. The answer is no. You can always, customize the wizard created rules afterwards.
For the starting flow name, I am going to use pyStartCase.
Would you like to create work? – If yes – the default case creation activities will be added in the wizard created rules.

In my requirement, I am going to create a new case, as soon as a new email comes to the configured email account. So yes.
Organization, Ruleset, Ruleset version – You can specify the integration rulesets.

Click next.
2. Inbound Email Configuration
The wizard lists the basic details you need to create an email listener rule. My next post will be on email listener
Within this step, there is a possibility to create 2 more rule instances in addition to email listener rule.
1. Email listener – You can see the last line on the bold information message in this screen.
If an email listener name specify already exists in the system, then the existing rule will be overridden by the values you enter here.
2. Email account – You can provide a new name to create a new email account or you can specify an existing email account.
Note: Step 2.3 helps to configure the email account rule form. If existing email account is used, the step 2.3 can be used to update the email account if needed.
3. Service package – Same as email account, You can provide a new name to create a new service package or you can specify an existing service package.
Note: Step 2.2 helps to configure the service package rule form. If the existing service package is used, step 2.3 can be used to update the service package if needed.
2.a. Email Listener Configuration
Email account name – CustomerService, existing email account

Email Listener name – ABCCustomerService, new listener.
Service Package – ABCEmail, new service package
Note: Please use a meaningful name.
Folder Name – INBOX, this will be max used folder to monitor.
Service class – provide the same class you specified in the first step.
Requestor User ID and Password – This is made mandatory, because, we cannot know if the service package requires authentication.
Just, provide a valid user ID and password. Remember, you can always update the wizard created rules 😉
Disable startup – On checking this option, the email listener will be disabled for every server startup. Always clear this. Use this option only when required.
Click Next.
Step 2.b. – Service package configuration

We will not look into the Service package configurations. We already discussed this in detail in a previous blog article on service package.
For now, we will accept the default and click next
Step 2.c. – Email account configuration

You can see, Pega provides us with a warning that the email account already exists in the system and modifying here will have some impact.
Again, We will not look into the Email account configurations. We already discussed this in detail in a previous blog article.
Click next.
You get into step 3, which is a review screen to finalize the rules.

Go on. Next

So you see, four rules are involved.
- Email listener, created
- Email account, modified
- Service package, created
- Service email created.
You can click and open the rules from the pointer. Click done, to complete the wizard.
So, we took a baby step in email processing and created the required rules via the email wizard.