Hi, What is the best way to handle and send an email with Rejected Rows on Error for tOracleOutput Component? And How to send RowsOnError as attachment? How to send RowsOnError as Email Message body? Can we raise an warn message and catch that warn and send an email?If so how transform Rejects to twarn? Please let me know how to build it. Appreciate your Help. KK
The 'Die on error' option can not be used with reject link together, if you want to use reject link, the 'die on error' option should be unchecked. You can send an email if the some rows are rejected. For example:
....tOracleOutput--reject--tFileOutputDelimited--runIf--tSendMail
It outputs the rejected rows to a file, this file can be attached in the mail if needed,
set the condition of runIf as:
((Integer)globalMap.get("tFileOutputDelimited_1_NB_LINE"))>0
If you want to send rejects rows as email Message body, you should pass rejects rows into context value by using tJavaRow firstly, and then getting the context value in Message body of tSendMail.
Here is a related forum for this scenario, please refer to:
https://community.talend.com/t5/Design-and-Development/resolved-Sending-the-content-of-tfileoutputde... Feel free to let us know if it is OK with you.
Best regards
Sabrina
Unless the reject file is so large that it would be impractical to Email it, I always send it as an attachment (.csv) which is more useful than having it in the Email body.