I am using tsendmail to send email with attachment report. But I realized that sometimes there is no data contained in the attachment report - so I am trying to find a way to not send empty file. I checked "don't send empty file" setting in my output component and I also unchecked the "die if attachment not exist" in tsendmail component. However, for below job, I will still receive email but with no attachment in my local server. what I want is to not send the email if the attachment file is empty.
If I still check "die if attachment not exist" I will get the error and the job will stop running. Usually A file is empty.
Can you please help me on this issue? Thanks so much!
Solved! Go to Solution.
Could you please try in slightly different way as shown below?
Allow the first subjob to put all the data to your output delimited files.
Verify the NB_LINE value for each file and add this condition as not equal to zero in condition check of run if.
Once you click the NB_LINE value, the value for each file will get converted as below.
If there are zero records, the control will not go to the tsendmail component.
Hope the reply has helped your query. Could you please mark the topic as resolved, if it has helped to close your query? Kudos are also welcome :-)
That is awesome news. There are always multiple ways to arrive at solution for same problem.
Could you please mark the topic as resolved so that it will help our fellow Talend community members?
Talend named a Leader.
Kickstart your first data integration and ETL projects.
Part 2 of a series on Context Variables
Learn how to do cool things with Context Variables
Find out how to migrate from one database to another using the Dynamic schema