Sending Email to Dynamic Address(context Variable)

0
In my job, I want to send Email to some email addresses which I want to read them from a file.

I have a tFileInputDelimited component with key;value Schema. As a key in every row there is this string: "Email" ,and as value there is an email address. After this component I put a tContextLoad Component. tFileInputDelimited is connected to this component with a main row. As we know, tFileInputDelimited component will repeat next components in its following chain, equals to its rows number.

Then, all of addresses will be loaded in context variable (Here the name of this variable is Email ). But I want each time, tSendMail component, send an email to this address. I put (String)((String)context.getProperty("Email")) in text box of TO field of tSendMail. I connect the tFileInputDelimited with an Iterate row to tSendMail.

What happen::
If tFileInputDelimited has 12 rows, only 11 rows will be sent to addresses. The last address will loose. Because in first time, before Loading the value of Email, tSendMail will be run. Then the first email will be sent to default value of Context Variable (Email), and the last loaded value will not be used by tSendMail.


What can I do?

Do you think there is another or better design of components for this job?
Elham's picture
11
Joined: Jan 29 2008 - 3:50pm
Last seen: 12 years 2 months ago

1 Answer:

0
Elham,

It's an interesting question. I haven't done a job quite like this before. I think your best avenue for help on this one is to post directly to the [url=http://www.talendforge.org/forum/index.php]Talend forum.

There's nothing that is particular to the JasperSoft technology in this instance, so it will have an identical solution in JasperETL and in Talend Open Studio.

Regards,
Matt
mdahlman's picture
11780
Joined: Mar 13 2007 - 2:43am
Last seen: 5 years 4 months ago
Feedback
randomness