This content has been archived.
Close popover

Table of Contents

How to configure email-based work processing


This article describes how to configure a PRPC application to automatically create and resolve work items using email. This approach depends on standard rules and capabilities introduced with PRPC 6.2 SP2.

In this simple example, a manager sends an email request to order required hardware. The email is received and validated and a work item is created automatically. Work is performed on the work item, and an email for manager approval is automatically created and sent. The manager receives the email, and replies by clicking the appropriate link to approve or reject. Upon receipt, the email is validated, and the work item is automatically processed and resolved.

This capability is limited to creating simple work items (with few properties) from an incoming email. As work items are resolved, the response is limited to selecting one flow action from a fixed list in the email. This diagram explains the process flow.

Suggested Approach

Part I: Create required email rules.

  1. Use the Email Wizard, sometimes called the Email Accelerator, to create email rules for creating and managing a work object. Select > Integration > Email > Email Wizard. See Developer Help for more information.

  2. Complete the Email Information form. Check the box beside Would you like to create work? Click Next.

  3. Complete the Email Listener form. In this example, the Listener is configured to monitor the Email Account called Grahl. Click Next.

  4. Complete the form to configure a Service Package. Click Next.

  5. Complete the Email Account form. Set a password, as that field may not be left blank. Click Next.

  6. The email configuration is complete. You can view the list of rules created. Click Done.

Part II: Validate email setup files and complete configuration.

  1. Locate the Email Account rule instance using Rules Explorer > Integration-Resources > Email Account. The rule appears as:

  2. Click Test Connectivityfor Sender and Receiver.

  3. Use the PRPC System Management application to validate that the new listener is running.

  4. The Email Wizard creates the Service Email rule and specifies the standard service activity pyCreateAndManageWorkFromEmail and parameters. If you are using an existing email service rule, add this activity and appropriate parameters, as shown below.

    The Request and Response tabs are also populated when you use the Email Wizard to create the Service Email rule. (If you did not use the Wizard, complete these fields.)

    On the Response tab, the when rules determine the contents of the response message, and whether a message is sent.

  5. In the Agent Schedule's Schedule tab, enable the ProcessEmailRequest activity.

    On the Security tab, include the access group of the work class that contains the flow to be processed.

Part III: Configure the flow rule.

  1. EquipmentRequest is the starting flow name referenced in the first screen of the Email Wizard. This very simplistic flow rule demonstrates how to create a work item from an email received by,the Receiver account you specified in the Email Account configuration.

    When the flow action is completed, an email with embedded Approve and Reject flow actions is automatically generated and sent to the manager from the Sender account you specified. This is accomplished through configuration on the Notifications tab on the ManagerReview assignment.

    The manager replies by clicking one of the flow action links in the email. The reply is received by, the email is validated, and the work item is automatically processed according to the flow action.

  2. Configure the Hardware Needed assignment. You may choose to set up routing for the incoming work item.
  3. Configure the ManagerReview assignment. The parameters on the Notification tab, Subject and CorrName, are required, and contain the following entries that enable an email to be sent for approval, returned, and automatically processed.

    You can customize the correspondence rule pzEmailActions , and save it to your work class. Do not remove the include tag <<include pxEmailActions>> in the correspondence rule. The tag causes the flow actions to appear in the outgoing email.

Part IV: Test your configuration using a sample email.

  1. To test, send an email to the address specified in the Email Listener rule. See pegatest0@gmail.comin this example.

  2. When the listener detects the new email in the account, the standard service activity pyCreateAndManageWorkFromEmail validates the email. If the validation is successful, a work item is created automatically, and a return email that provides the new work item number (ER-168 in this example) is sent. If validation errors are detected, a failure email is sent to the requestor.

  3. In the portal, you can verify that work item ER-168 is created. The subject line of the email populates the work item description.

  4. The operator assigned to the work item clicks the flow action Select Hardware , makes a selection, then clicks Submit, advancing the work item to the next step in the flow, ManagerReview . An email is generated, sent out, and also attached to the work item.

  5. Click the attachment to view the email contents.

  6. The email is received by the account in this example and contains the two flow action links you defined in your flow. The flow actions appear as a result of the <<include pzEmailActions>> in your correspondence rule.
  7. The manager clicks the appropriate action, approve or reject, and can enter text, if desired. The Subject line is populated using parameters you supplied on the Notification tab of the assignment. The reply is sent to (in this example).

    Some email clients may not properly handle the mailto parameters.

  8. The service activity pyCreateAndManageWorkFromEmail validates the incoming mail. The email is attached to the work item, which is then resolved (either approved or rejected as indicated), and the item status changes accordingly.

  9. Click Audit to view the history of the work item. As indicated below, the pyProcessEmail Request email agent handled the processing automatically.

Suggest Edit

75% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.