Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Enabling inline images in email triage cases

Updated on February 10, 2023

Update the configuration for your Pega Email Bot™ so that the system can display images inline in the rich text format for triage cases. By showing images in rich text format, you reap the following benefits: make the information more presentable, improve the overall user experience, and increase the performance of the system for users and customer service representatives (CSRs).

When the email bot generates triage cases from user emails, the system might not display images in the email body inline in the rich text format. To fix this issue, configure the auto-generated service email rule for your email bot to store the email body as an HTML attachment. Also, configure the email listener rule for your Email channel so that it does not embed inline images.

When you perform the following configuration steps, you ensure that the system saves the email body and its inline images as attachments. At run time, to increase performance, the system then changes these attachments to the triage case to display as inline images in rich text format.

Note: For security reasons, by default, in triage cases, the system does not display images that have an external URL. For example, images that have an external URL in emails might be a target for SQL injection attacks. To display such images in triage cases, define the external domains where the images are stored in the pyAllowedDomainsForInlineImages data transform rule.
  1. Switch to Dev Studio.
  2. Configure the email listener rule not to embed inline images into the HTML:
    1. In the navigation pane of Dev Studio, click Records.
    2. Expand the Integration-Resources category, and then click Email Listener.
    3. In the list of email listener rule instances, open the rule used by your email bot by clicking the rule's name.
      To find the email listener that your email bot uses, edit the email listener rule. When you edit the rule, on the Properties tab, in the Email account section, ensure that the email account in the field is the same account that you defined for your Email channel on the Configuration tab, in the Email handling section, in the Email accounts list. For more information, see Creating an email listener and Exploring email configurations.
    4. In the email listener rule, click the Process tab.
    5. In the Data options section, clear the Embed data for inline images into HTML check box.
      For example: The following figure shows where you clear this checkbox in the email listener rule so that you do not embed inline images into the HTML:
      The email listener rule for an email bot
      The Process tab of the email listener rule that is used by an email bot.
    6. Click Save.
  3. Configure the service email rule to store the email body as an HTML attachment:
    1. In the navigation pane of Dev Studio, click Records.
    2. Expand the Integration-Services category, and then click Service Email.
    3. In the list of service email rule instances, to open the rule for your email bot, click the rule name.
      To find the service mail rule that your email bot uses, edit email listener rule for your email bot. When you edit the rule, on the Properties tab, in the Listener properties section, check the name of the service mail rule in the Service package field. For more information, see Creating a Service Email rule and Exploring email configurations.
    4. In the service email rule, click the Request tab.
    5. In the Message data section, in the Handle HTML content list, select As HTML attachment.
      For example: The following figure shows where you select the option to handle HTML content as attachment for message data in the service email rule:
      The service email rule for an email bot
      The Request tab of the service email rule that is used by an email bot.
    6. Click Save.
  4. Optional: To hide inline images from also displaying as attachments in triage cases:
    1. In the navigation pane of Dev Studio, click App, and then search for the Data-WorkAttach-File class.
    2. Expand the DecisionWhen section for the Data-WorkAttach-File class, and then click pyDisplayEmbededFileAsAttachment .
    3. In the pyDisplayEmbededFileAsAttachment when rule, in the Set conditions section, in the first list in the row select Always, and then in the second list, select is false.
      For example: The following figure shows the Conditions tab for the pyDisplayEmbededFileAsAttachment when rule where you set its condition to false so that the system hides images from also displaying as attachments in triage cases:
      The pyDisplayEmbededFileAsAttachment when rule for an email bot
      The Conditions tab of the pyDisplayEmbededFileAsAttachment when rule that is used by an email bot.
    4. Save your changes by performing one of the following actions:
      • To save the rule that belongs to a locked ruleset to an isolated sandbox so that you can test your changes, click Private edit.

        For more information, see Performing a private edit.

      • To save the rule to a ruleset, click Save as.
    By default, the system displays inline images in triage cases also as attachments.
  5. Optional: To display externally referenced images in triage cases, perform the following steps:
    1. Search for the pyAllowedDomainsForInlineImages data transform rule, and open the rule.
    2. On the Definition tab, click the Add a row icon.
    3. In the Action column for the row, select Set.
    4. In the Target column for the row, enter: pxResults(<APPEND>).pyNote
    5. In the Source column for the row, enter the domain where you store an external image in double quotation marks.
      For example: The following figure shows the Definition tab for the pyAllowedDomainsForInlineImages data transform rule that lists one external domain from which you can display images in the system, "www.sampledomain.com":
      The pyAllowedDomainsForInlineImages data transform rule for an email bot
      The Definition tab of the pyAllowedDomainsForInlineImages data transform rule that is used by an email bot.
    6. Optional: To define additional domains where you store your external images, repeat steps 5.b through 5.e.
    7. Click Save.
  6. Optional: To encrypt sensitive information embedded in inline image HTML tags for a triage case, add URL mappings in the system.
  7. Switch back to App Studio.

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us