Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
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!
Hi,
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.
((Integer)globalMap.get("tFileOutputDelimited_1_NB_LINE")) !=0
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 🙂
Warm Regards,
Nikhil Thampi
Hi,
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?
Warm Regards,
Nikhil Thampi