To complete this task, you select an activity that you want to configure for sending email attachments. Then, in that activity, you create and populate the .pxResults attachment page (for example, InlineAttachmentPage.pxResults) by using the pzInsKey object handle of the attachment. Finally, you call an automation that references the attachment page that you created.
- In the header of Dev Studio, search for and open the activity rule that you want to edit.
- Click the Pages & Classes tab.
- Click Add item and then populate the Page
name and Class fields for the following
Page Name Class Sample value <attachment_page_name> Code-Pega-List InlineAttachmentPage Note: You can assign a custom name to the attachment page. <attachment_page_name>.pxResults Embed-ContentSource-LinkAttachment InlineAttachmentPage.pxResults
- Click the Steps tab.
- Click Add step and then populate the
Method and Step page fields
for the following activity steps:
Method Step Page Sample value Page-New The name of the attachment page that you created in step 3. InlineAttachmentPage Page-New <attachment_page_name>.pxResults(1) InlineAttachmentPage.pxResults(1) Property-Set <attachment_page_name>.pxResults(1) InlineAttachmentPage.pxResults(1)
- Optional: To provide more details about the step, in the Description field for each new step, enter a short step summary.
- Drag the new steps in the target positions within the activity, as shown in the following figure:
- Set the attachment properties:
- In the Property-Set activity step that you created in step 5, expand the Method Parameters section.
- Click Add item and then populate the
PropertiesValue fields for the following
PropertiesName PropertiesValue Additional information .pzInsKey Sample value:LINK-ATTACHMENT PEGASOCIAL-DOCUMENT DOC-9848022338!20190327T194337.398 GMT The object handle must have the following format: CLASSNAME CLASSKEY ! NAME #YYYYMMDD T HHMMSSTTTTMMM GMT .pyContentTransferEncoding Sample value: "Base64" Provide the attachment encoding type. .pyContentType Sample values:
- "" (default)
- "application/pdf" for a PDF reader (for example, Acrobat Reader)
- "application/ms-tnef" for Microsoft Outlook or Microsoft Exchange
(Optional) Populate this property to communicate the attachment extension to the email client. This way the client can select the appropriate application to open the attached file. .pyContentID Sample value: param.ContentID
Set this parameter for inline attachments only. This parameter is the header for referencing the attachment from the message body.
You can get this ID by inspecting the body of the email HTML markup. For example, if the body contains the <IMG SRC="ContentID: PegaLogo"> tag, the email client expects an attached image whose ContentID value is PegaLogo. The email client displays the image in place of the <IMG SRC="ContentID: PegaLogo"> tag while rendering the HTML body of the email.
.pxObjClass "Embed-ContentSource-LinkAttachment" Set this object class for any attachment type. For example: The following figure shows sample attachment property values within the .pxResults page: Tip: You can send multiple attachments in a single message by creating and setting additional pxResults pages, for example, InlineAttachmentPage.pxResults(2), InlineAttachmentPage.pxResults(3), and so on.
- Add a step for creating and sending email through the
- On the Steps tab, click Add step.
- In the Method field, enter Call-Automation.
- Expand the Method Parameters section.
- In the Resource field, select Email message.
- In the Automation field, select Create and send email.
- In the Inputs section of the
Call-Automation step, specify the attachment type that
you want to add to the message:
- For resources that you want to embed in the email Attachments section, in the Attachments field, enter <attachment_page_name>.pxResults.
- For attachments that you want to embed in the email HTML body, in the Embedded Content field, enter <attachment_page_name>.pxResults.
For example: The following figure shows the Call-Automation step when you embed an inline attachment:
- Save the activity.