Two Stars

Send an email when Job fail

Hi! I'm trying to configure tSendMail component, but I don´t know how I store information of job to show in the mail body. I have 3 subjob and I want to send an email only at the finish and when the subjob fails. I attached the picture of my job. What are the variables I must store?
Thank you
Regards
5 REPLIES
Moderator

Re: Send an email when Job fail

Hi,
Could you please take a look at related topic http://www.talendforge.org/forum/viewtopic.php?id=35043?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Four Stars

Re: Send an email when Job fail

Hi Caro,
What information you want to store and send it in email related to job?
Use tPostJob-->onComponentOk-->tSendMail
In above configuration, job would send mail after completion as well as after error during job execution...
Various system variables are available during job execution which could be called directly inside mail component and you can even do html formatting...
Thanks
Vaibhav
Two Stars

Re: Send an email when Job fail

Hi! Thank you very much for your suggestions; I try to do some like this:
Subjob 1--->OnSubjobError--> tSendMail
|
| OnComponentOK
|
Subjob 2---->OnSubJobError-->tSendMail
|
| OnComponentOK
|
SubJob 3----->OnSubJobError-->tSendMail
As the schema above shows, I need to put in every subjob a tSendMail component, to achieve that send an email only when any subjob fail. Is there another way to do this, avoiding to repeat each tSendMail component.
Thank you very much
Best Regards.
Moderator

Re: Send an email when Job fail

Hi,
Is your expected result sending all error messages(subjob 1, subjob2 and subjob3) to an mail by one tsendmail? or 3 mails by one tsendmail(send 3 times)?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Two Stars

Re: Send an email when Job fail

Hello Sabrina, I want to send an email for all error messages by one tSendMail component.

Thank you
Best regards