[resolved] If job fails send an email

Four Stars

[resolved] If job fails send an email

Hi,
I have primary key constraints and I want Talend to send me an email whenever any duplicates come in. Below is my job architecture. I have `unchecked` Die On Error for all components. Even after the job fails since there are duplicates coming in the database, I do not get any email notifications. Can someone please provide headway on this issue.

I am using outlook and my settings are as below. I do not know what the SMTP Host and the SMTP port so I am leaving it as the default settings.

Thanks in Advance,
CG
  

Accepted Solutions
Thirteen Stars

Re: [resolved] If job fails send an email

You can test:
"Hello Colleen, a duplicate in the file has been spotted. The Duplicate value is "+row3.Last_Name_First_Name+", "+row3.Address_of_New_Home+" and "+row3.Week+". Please have a take a look at it. Thanks".

I not test it, but if will not work with flow - insert in middle (between tMap and tSendMail) - tFlowToIterate, and use in text
"bla-bla-bla ... "+((String)globalMap.get("var_name"))+"... bla-bla-bla"

this is will work exactly
-----------

All Replies
Ten Stars

Re: [resolved] If job fails send an email

SMTP Host is the hostname or IP address of your mail server.  25 is the default network port for SMTP communication.
If you have not changed those values to the values you use to send mail, tSendMail will not work.  
Four Stars

Re: [resolved] If job fails send an email

Thanks,
I have updated my tSendMail with the accurate Host and Port. I even tried out the Host and Port with a simple job. But the problem remains, I am unable to receive the email from Talend.

I am emulating my process from the details from the link.
https://www.talendforge.org/forum/viewtopic.php?id=17072
Please provide assistance.
Thanks,
CG
Thirteen Stars

Re: [resolved] If job fails send an email

If You look at Your Reject output, You can see - on both Your screenshots it 0 (or empty)
It mean - tMap not send rows to Reject flow, and Your tWarm not fire
as result - tLogCatcher - not fire as well

Check tMap - why it not send rejected flow?
Handle duplicates by other method

Just add - tMap do not reject nothing without Lookup JOIN.
and You Job do not have any one.
in this case tMap can send something to Your rejected output only based on some filters or function - if You use any of them, check why they not work. 
-----------
Four Stars

Re: [resolved] If job fails send an email

Thanks, I have figured out another way to email myself the error.
 
As you can see the there is one duplicate value and I received an email from Talend as well fortunately. 
This is my current message in the body of the tSendMail. 
"Hello Colleen, a duplicate in the file has been spotted. Please have a take a look at it. Thanks". 
I want to send three columns from the duplicated value ("Last_Name_First_Name", "Address_of_New_Home" and "Week") in the message in the tSendMail. My message in the body be:
"Hello Colleen, a duplicate in the file has been spotted. The Duplicate value is "Last_Name_First_Name", "Address_of_New_Home" and "Week". Please have a take a look at it. Thanks". 
Please provide assistance.
Thanks,
CG
Thirteen Stars

Re: [resolved] If job fails send an email

You can test:
"Hello Colleen, a duplicate in the file has been spotted. The Duplicate value is "+row3.Last_Name_First_Name+", "+row3.Address_of_New_Home+" and "+row3.Week+". Please have a take a look at it. Thanks".

I not test it, but if will not work with flow - insert in middle (between tMap and tSendMail) - tFlowToIterate, and use in text
"bla-bla-bla ... "+((String)globalMap.get("var_name"))+"... bla-bla-bla"

this is will work exactly
-----------
Four Stars

Re: [resolved] If job fails send an email

Thanks so much Vapukov, worked like a treat!!!!
One Star

Re: [resolved] If job fails send an email

How to give the path of the file in the tsendmail component. Its giving me error. please help
Thirteen Stars

Re: [resolved] If job fails send an email

How to give the path of the file in the tsendmail component. Its giving me error. please help
415061/mini_blob_20170308-1213.png

remove / from the end
-----------