cancel
Showing results for 
Search instead for 
Did you mean: 

Send multiple attachment files in a single mail retrieving multiple files from SFTP

yogesh_kumar_15
Explorer
0 Kudos

Hi folks,

I have a requirement where, the SF team will post multiple report files (regardless of file formats) into the SF SFTP.

CPI needs to pull all those files and send a single mail to recipients with all those files as attachments.

Things I have done,

  • I have used poll-enricher in a looping process call to retrieve all the files from the SFTP.
  • But I'm not aware of how to send those each files polled from SFTP. Can anyone throw some idea on it. Adding my Iflow for the reference.

I thought of gathering it in a zip file using gather step but its not working.

Mail adapter config:

If someone has worked on the same scenario, do throw some idea over it.

Thanks.

View Entire Topic
VijayKonam
Active Contributor
0 Kudos

Do you know if the number of files is constant or it could be dynamic? Based on that you may need a loop terminating condition. You could inside the loop, after fetching the file, add that to attachment of the message object in a groovy. Once you terminate the loop, make sure in the mail adapter, attachments are allowed to be sent over.

Just my initial thoughts.

yogesh_kumar_15
Explorer
0 Kudos

Thanks Vijay for your opinion. As of now, there are 6 files placed in SFTP. And could you brief me about how to pick all the file attachments in the message object by Groovy?

Thanks again.