talendeai

Sending multiple emails with data from rows in Talend Open Studio


I m working of a project of Enterprise application architecture using software talend i have this table : User(Id_user, name_user, Email) what i want to do is select Data from this table and sending email to each user using Tsendemail component
i could so far make a connection to Database using TMssinput and send a single email using Tsendemail
but i dont know how to select values of Row and use them as "email" for Tsendemail

Can someone help me pls ? and thank you


Solution

  • As tSendMail component is not a processing component (ie, it cannot handles more than one vector in input) but a starting component, the best way to do so is to use the good-ol' tFlowToIterate as we did here. Your job will almost look like:

    tMssInput---row---->tFlowtoIterate--->Iterate---->tSendEmail
    

    Inside the tFlowToIterate instance you're going to put everything you need from row into the globalMap. Every data-processing operation should be done before that, on the row context (for example, filtering out users you won't the mail to be sent, etc.).