Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sbhadra
Contributor II
Contributor II

Attach multiple documents using tsendmail

Hi All,

 

I have a query which will pull in some physical paths which is present in a database table. Along with that I need to replace the filename as well. Let say for eg:- 

 

The path is 

/data/media/10000234.csv

 

The original name of the file is hello.csv. I need to replace this 10000234 with hello. Secondly there can be additional paths which would be pulled in from the query and they would have some different filenames.

 

So, in this scenario I would like to get all the files which may be present in various locations replaced with their filenames and attach to a single email.

 

Please suggest

Labels (2)
7 Replies
TRF
Champion II
Champion II

I strongly suggest you to move all required files into a temporary folder, then attach the folder to email (instead of attaching all single files). 

sbhadra
Contributor II
Contributor II
Author

Hi TRF,

 

Please suggest if we attach a folder will it send a single email or it will send multiple emails?

TRF
Champion II
Champion II

1 email with multiple attachments
Anonymous
Not applicable

Did you click the plus button to add as many lines as needed where you can put filemask or path to the file to be sent along with the mail? Is there any error when option "Die if the attachement file doesn't exist" is checked out? mcdvoice login

TRF
Champion II
Champion II

@Lawson, this works only if you can predict which files will be there for attachement.
Else you need to attach a folder if you want 1 email with multiple attachements.
TRF
Champion II
Champion II

Did this help? If so, thanks to mark your case as solved (Kudo also accepted)
aminegac
Creator
Creator

@Fred Trebuchet​  HI great solution , i already thougth about moving specific files to temporary folder to avoid main folder uneccessary files , but is it possible like Lawson said to write a mask inside tsendMail component?? because i only see mask in tFileList for exemple but in tmailSend there is no place to write the mask in it .so how can we mention the mask ??

Talend OS 4 yrs / Java 17 Web Dev