How to send email with attachments
A standard activity allows you to send all the attachments of a work item as email attachments. A standard function allows outgoing email messages to include attachments.
To send an email message with all the attachments of a work item
- Open the work item on the clipboard. The work item may be open or resolved.
- Call the standard activity @baseclass.SendEmailWithAllAttachments. In the
ReferencePage
parameter, identify the name of the clipboard page that contains the work item, such as pyWorkPage
.
- Using information in the work item, this activity creates a page of class Data-EmailAttachments containing all the work item attachments. This activity then calls the standard activity SendEmailNotificationWithAttachments, which later calls the standard function described in this topic.
To send an email message with any set of attachments
You can use this for attachments unrelated to any work item, or to send only some of the work item attachments.
- Make each email attachment the value of a clipboard property. These can be on the same or different pages and may include binary (non-character) data.
- Create a new page of class Data-EmailAttachments, with a name of your choosing.
- Add a single property .pyAttachment to the page; this is a
Page List
property of class Embed-EmailAttachment.
- 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 email server. All work item 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 email 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 email server. For technical reasons, all work item 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.
- Call the standard function SendEmailWithAttachments() (in the Pega-ProCom:DEFAULT library) supplying the page name as the
AttachInfo
parameter.
You 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 () on a user 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. User Interface category
Open topic with navigation