Using submitForApprovalsWithAttachments API to send Files
You can also use this API to send files instead of attachments. Sending files is a four-step process as follows:
- Select the process ID and file ID (or attachment ID) to submit.
- Clone the email templates using the CloneEmailTemplate API. You need to clone the email templates to create temporary templates before you can copy attachments to them.
- Copy the files or attachments using the CopyAttachment API.
- Get the developer names of the email templates you want to use. Create a map with the template field names and their respective template developer names and pass this to the submitForApprovalsWithAttachments API in the processProperties parameter.