I have a requirement to send an email on case submission using a Call-Automation step with:
Data-Corr-Email → Create and send email
The email is sent successfully. Email sent via Call-Automation, not Email Notification rule
Now, I need to attach the same sent email to the case, so it appears in the Case Attachments section (as correspondence). Need the email (subject + body) saved as a case attachment.
Version used: Pega Infinity '25.1.2
Questions:
What is the recommended OOTB approach to attach the sent email to the case when using Data-Corr-Email automation?
Should we use CorrNew after the Call-Automation step, or is there a better way to reuse the already generated email content?
Is there any direct way to persist the email generated by the automation as a Data-WorkAttach-Corr instance?
Any guidance on the best practice for this scenario would be appreciated.
The recommended approach is to separate sending from persistence. Data-Corr-Email will send the message but it may not the best place to also persist the same content as a case attachment. Instead store the generated subject/body on the case, send the email, and then create a correspondence attachment step afterward so the email content can be saved and shown in Case Attachments.
Personally, I would avoid relying on a direct automatic conversion of the sent email into Data-WorkAttach-Corr since that is not the standard OOTB pattern. Use the send the email smart shape then add a separate step to create a correspondence attachment on the case. That keeps sending and persistence decoupled.
Also, I am not seeing an OOTB option that automatically converts the sent Data-Corr-Email output into a Data-WorkAttach-Corr instance as part of the send action itself. The usual pattern is to either save the generated output as an email artifact separately or attach the email content as a case correspondence using a dedicated step.
To attach the sent email to your case, call the Work-.AddAttachmentFromStream activity immediately after your email automation step finishes. You must map the email’s subject and HTML body into the activity parameters while ensuring the insKey property is set to your current case ID. This activity automatically generates a Data-WorkAttach-Corr instance and links it to the case’s attachment section as a correspondence record. This approach allows you to persist the specific email content generated by the automation without needing to re-send or re-generate the message. It is the most direct ootb method to ensure custom email streams are saved to the case history in Pega Infinity '25.1.