To send Email after reading data from an excel sheet

One Star

To send Email after reading data from an excel sheet

Hi ,
I am very much new to TALEND ETL tool. I have a small requirement. I have an excel sheet which has 4 columns. ID,Manager level-1,Manager Level-2,Time Status. I need to read this excel sheet and have to send a mail based on the data in TIME SHEET STATUS column.
i.e. If the time Time sheet status is 'Unapproved' it should send mail to Manager level-1 email id .If it is approved,it should send to Manager Level-2.
Please help me on this.
Report.txt.txt
One Star

Re: To send Email after reading data from an excel sheet

i have uploaded it as txt file,as CSV file not able to upload
One Star

Re: To send Email after reading data from an excel sheet

Hi ,
i haven't received any solution to this. Somebody please help. I have used a tfileinputexcel component to read the data from this excel sheet. After that,how to read a particular column and send email.
Seventeen Stars

Re: To send Email after reading data from an excel sheet

hi naksh,
 Have you got differents status for each line (for one sheet) ?
Or each excel file has one status : approved - unapproved
So for each sheet or for each line (depend on), you have to catch the value of 'time status' & send a mail.
For this you I will use a tFlowToIterate (that put flow value in globalMap) and after that link with trigger conditionner 'run if'.
if TimeValue equals approved => send mail 1
otherwise => send mail 2
https://help.talend.com/search/all?query=tFlowToIterate&content-lang=en
https://help.talend.com/search/all?query=Connection+types&content-lang=en
hope it help
One Star

Re: To send Email after reading data from an excel sheet

hi naksh,
 Have you got differents status for each line (for one sheet) ?
Or each excel file has one status : approved - unapproved
So for each sheet or for each line (depend on), you have to catch the value of 'time status' & send a mail.
For this you I will use a tFlowToIterate (that put flow value in globalMap) and after that link with trigger conditionner 'run if'.
if TimeValue equals approved => send mail 1
otherwise => send mail 2


hope it help

Thanks a lot Kzone for your response
One Star

Re: To send Email after reading data from an excel sheet

Hi Kzone,
Using your approach of 'tFileInputDelimited--row1--tFlowToIterate--iterate--tJava--runIf--tsetglobalvariable--row2(main)--tSendmail' ,i have succeeded in sending mail from gmail server using following detailssever HOST: "smtp.gmail.com" and PORT :465.Thanks a lot for that.
But i am facing issue when i send from my organisation's mail server(details given below). i am getting the below error. What could be the reason.how can i solve this?
Exception in component tSendMail_1
javax.mail.MessagingException: Could not connect to SMTP host: mail.ourclients.com, port: 587;
nested exception is:
java.net.SocketException: Permission denied: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1282)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
--Please help me on this.
 Thanks in Advance.
Moderator

Re: To send Email after reading data from an excel sheet

Hi nakshh,
Here is a reponse for your issue on forum:http://www.talendforge.org/forum/viewtopic.php?id=26629. Could you please check it?
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.
One Star

Re: To send Email after reading data from an excel sheet

Hi All,
I am working on talend 5.6.2 data services through big data.
I writing a data to excel using tFileExcelOutput component and running the job from unix env using sh file.
I am running the job parallel from two UNIX terminal with two diff users.
Job from second window is getting failed with the below error
Exception in component tFileOutputExcel_2
java.lang.RuntimeException: java.io.IOException: Permission denied
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:628)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:645)
at org.talend.ExcelTool.prepareXlsxFile(ExcelTool.java:131)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_4Process(ConfigCheck_Copy.java:4478)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_3Process(ConfigCheck_Copy.java:11962)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_8Process(ConfigCheck_Copy.java:11350)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_12Process(ConfigCheck_Copy.java:10652)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_13Process(ConfigCheck_Copy.java:10244)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlInput_1Process(ConfigCheck_Copy.java:9873)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tMysqlConnection_1Process(ConfigCheck_Copy.java:9322)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tHDFSConnection_2Process(ConfigCheck_Copy.java:18039)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy.tJava_3Process(ConfigCheck_Copy.java:18300)
at talendrunbook.configcheck_copy_1_0.ConfigCheck_Copy$6.run(ConfigCheck_Copy.java:18922)
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:1006)
at java.io.File.createTempFile(File.java:1989)
at org.apache.poi.util.TempFile$DefaultTempFileCreationStrategy.createTempFile(TempFile.java:105)
at org.apache.poi.util.TempFile.createTempFile(TempFile.java:60)
at org.apache.poi.xssf.streaming.SheetDataWriter.createTempFile(SheetDataWriter.java:80)
at org.apache.poi.xssf.streaming.SheetDataWriter.<init>(SheetDataWriter.java:63)
at org.apache.poi.xssf.streaming.SheetDataWriter.<init>(SheetDataWriter.java:68)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheetDataWriter(SXSSFWorkbook.java:292)
at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:69)
at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:624)
... 12 more

Even a small help is appreciated. Thanks in advance.
Moderator

Re: To send Email after reading data from an excel sheet

Hi gokulpotluri,

Here is a response from your another topic:https://www.talendforge.org/forum/viewtopic.php?id=45401.Could you please take a look at it?
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.