Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get console contents into tSendMail email message content?

Hi, as per title, I'd like to see what my console prints out in the email message content
My canvas image is attached
What do I need to put in the Message field in order to achieve this?
I've tried various selections from the ctrl spacebar dropdown list (without editing any of them) as per this page https://help.talend.com/search/all?query=tSendMail
For example, I have tried putting:
((String)globalMap.get("tMysqlOutput_1_ERROR_MESSAGE"))

In the Message field
My incoming email message content is
""

Thank You 0683p000009MACn.png
Labels (2)
9 Replies
Anonymous
Not applicable
Author

This design cannot work. If you get a reject flow no error messages will be put into the globalMap.
The reject flow contains in two additional columns the message and the exception why this dataset is rejected.
You should use these informations!
Anonymous
Not applicable
Author

Hi, what design would you recommend to capture errors and email their contents in this case?
Thank You
Anonymous
Not applicable
Author

I would store the rejected datasets (including the additional errorMessage) into a file.
In a new subjob I would check the counter tDBOutput_REJECTS and if it not null and greater than 0 I would send an email with the created file as attachment.
Anonymous
Not applicable
Author

Thanks for sharing; sounds rather different from what I'm currently doing here
Anonymous
Not applicable
Author

Yes it is different but I am confident it is more stable and maintainable.
Anonymous
Not applicable
Author

Hi
You can also consider to use a custom component called tRedirectOutput to redirect the entire message printed on the console to a text file, and send an email with the file if the job run fails, the job design looks like:
tMysqlInput--main--tMap--tMysqlOutput
|
onsubjoberror
|
tSendmail
About tRedirectOutput component, please read this topic:
http://www.talendforge.org/forum/viewtopic.php?pid=108078#p108078
Shong
Anonymous
Not applicable
Author

Hello, and thank You for your reply 0683p000009MACn.png
tRedirectOutput is omitted from your job design example; how does it fit in to your above design recommendation?
Anonymous
Not applicable
Author

Hi Shong, still interested to know how tRedirectOutput fits into your recommended design
Thanks 0683p000009MACn.png
Anonymous
Not applicable
Author

Hi
The job is designed as below:
tPreJob--oncomponentOK--->tRedirectOutput
tMysqlInput--main--tMap--tMysqlOutput
|
onsubjoberror
|
tSendmail
Let me know if you have any questions.
Shong