How to attach a pega binary file to an email?

How to attach a pega binary file to an email?

I would like to attach a local file to the email when sending it. I will create a binary file rule with pega for the local file. How can I attach this file when sending an email? I tried to attach content to the attachment in the flow by specifying the attachment type via email, but failed as the file was not sent correctly.

@LiXiangTang What type of file you want to attach? Make sure it has an instance of Link-Attachment Class in pega. Then you can get the key of the file and send it by using SendEmailWithAttachments OOTB activity.

@ronisattwik Hi, PDF file. I attached the PDF file to the case and wanted to send it through the SendEmailWithAttachments activity, but the email I sent will not include this PDF file. Unless I add an assignment box in the middle, it can be sent out normally. May I ask what I should do?

@LiXiangTang If the PDF file is already attached to the case (i.e. it must be showing in the recent contents) then instead of a assignment shape plug a utility shape and write a custom activity of type utility where you are fetching the key of the document you want to attach with D_pyCaseContent OOTB data page and then passing the fetched key to the SendEmailwithAttachment Activity.

Let us know if it helps. Ideally we should not plug an unnecessary assignment shape.

@ronisattwik I hope to use attach content to add a file in the process, and then send this file via email through activity SendEmail with Attachment. The middle assignment is not necessary, it is only for testing purposes. It was found that without this assignment, the file cannot be sent out.

I just want to attach files and send them via email. The content in the red box in the middle should be deleted.

After attach content, add a commit activity can work.