Back Forward How to send e-mail with attachments

A standard activity allows you to send all the attachments of a work object as e-mail attachments. A standard function allows outgoing e-mail messages to include attachments.

To send an e-mail message with all the attachments of a work object

  1. Open the work object on the clipboard. The work object may be open or resolved.
  2. Call the standard activity @baseclass.SendEmailWithAllAttachments. In the ReferencePage parameter, identify the name of the clipboard page that contains the work object, such as pyWorkPage.
  3. Using information in the work object, this activity creates a page of class Data-EmailAttachments, containing all the work object attachments. This activity then calls the standard activity SendEmailNotificationWithAttachments which later calls the standard function described in this topic.

To send an e-mail message with any set of attachments

You can use this for attachments unrelated to any work object, or to send only some of the work object attachments.

  1. Make each e-mail attachment the value of a clipboard property. These can be on the same or different pages and may include binary (non-character) data.
  2. Create a new page of class Data-EmailAttachments, with a name of your choosing.
  3. Add a single property .pyAttachment to the page; this is a Page List property of class Embed-EmailAttachment.
  4. For each attachment, complete a pyAttachments() page that contains adding values for these properties:
    • pyDecode — A True or False property. Set this property value to True if the property value is Base64-encoded and must be decoded before sending to the e-mail server. All work object attachments of standard types are Base64-encoded except notes (Data-WorkAttach-Note class) and URLs (Data-WorkAttach-URL class).
    • pyName — A Text value for the name of the attachment as it will appear on the e-mail message. This value also used as the file name when the attachment is saved to disk; the name can end in a period followed by a file type.
    • pyReference — A Text value containing a property reference to the content of the attachment.
    • pyRemoveXML — A True or False property. Set to True to indicate that the contents of the attachment are wrapped in XML that must be stripped before sending the attachments to the e-mail server. For technical reasons, all work object attachments of class Data-WorkAttach-ScanDocument and Data-WorkAttach-ScreenShot have such wrappers.
    • pyType — An optional Text property specifying the file type of the content, such as doc, jpg, or png. Include this property value if the pyName value does not end with a file type.
  5. Call the standard function SendEmailWithAttachments() (in the Pega-ProCom:DEFAULT library) supplying the page name as the AttachInfo parameter.
zzzYou can view outgoing email messages and their attachments in the Attachments section of the History/Attachment window. To open the window, click the History and Attachments icon ( zzz ) on a work object form. When you select an email, you can open its attachment (if any) by clicking the Attached link within the View Email pop-up window. This feature enables you to confirm that the email and its attachments are correctly associated. Where there are multiple attachments, selecting one displays them all.
Definitionsattachment

UpUser Interface category