You are here: Reference > Rule types > Correspondences > Correspondence concepts and terms

Correspondence

Your application can send messages to both other users and people who are not users of the system. Correspondence refers to letters, emails, forms, and similar materials that are sent to these parties.

You can send correspondence by email, fax, text message, and conventional mail.

Adding correspondence to an application

Use these facilities to build correspondence into an application:

  1. Create a correspondence rule (Rule-Obj-Corr rule type) that contains the body of the message for each correspondence type. The correspondence type of the correspondence rule identifies whether the correspondence is a printed letter, a fax, an email, or a text message.
  2. Compose the body of the message. The HTML text in the correspondence rule can contain source HTML and JavaServer Page tags or directives. For example, the Include directive or include JSP tag can insert HTML from another correspondence rule, or from a correspondence fragment rule (Rule-Corr-Fragment rule type) into the current stream. The Reference directive or reference JSP tag can insert text from a clipboard value, to personalize the correspondence.
  3. Ensure that work parties who are to receive correspondence each have a contact preference and a corresponding address. For example, if the contact preference is email, an email address is required.
  4. Identify a point in a flow when the correspondence is generated and the data needed is available. Update the flow to include a Notify shape, a correspondence-related flow action such as Work-.Notify, or a Utility shape. Use a flow action when human input is needed to select the message, enter data values for the message, or edit the message.

Generation at run time

As a flow execution advances, it can create correspondence automatically, notifying affected parties about the progress of the work item, needed information or signatures, and so on. The system tries to send correspondence using a medium and address recorded in recipient's contact preferences.

As with HTML rules, the system's stream processing facility evaluates the JSP tags or directives in the context of a user's current clipboard and RuleSet list.

Sent correspondence is linked to the work item as an instance of the Data-Corr-Email class. Unlike true work item attachments, correspondence is a permanent record and cannot be deleted once saved.

Sending correspondence

When correspondence is generated, it is queued for the Pega-ProCom agent, which periodically sends correspondence.

Most correspondence is sent by using email. Outgoing email is supported by an appropriately configured Data-EmailAccount data instance.

If the correspondence is to be printed or faxed (rather than sent as email), the HTML file (as a ZIP archive, with image files if any) is sent to a server running Windows. This application formats the resulting HTML file using the powerful capabilities of Microsoft Word, and then sends the results to a printer or fax-out board.

Default connection timeouts and IO timeouts are set to one minute. You can change either setting by using the email/timeoutDynamic System Setting for Pega-Intsvcs.

Localizing correspondence

An application can include versions of correspondence in multiple languages, even when the application itself hasn't been localized. For example, a standard email message can be translated into Spanish and German so users can correspond with customers (or other parties) in the language that the recipient prefers. By convention, the original version (in English, for example) is treated as a base rule, and the Spanish and German versions are circumstance-qualified based on a property such as pyCustomer.pyCountry. Thus, a customer in Germany receives the German version, and so on.

Standard activities

These standard activities support correspondence generation and sending:

Related topics About Email Account data instances
About the Email wizard
Understanding the Pega-ProCom agent
Understanding the Pega-IntSvcs agent
Standard rules Atlas — Initial Email Account data instances