One Star

Trigger job based on contents of incoming/outgoing emails

What do i need to do in TOSDI 6.2.1 to trigger a job to run based on the contents (i.e. "Sent from", "Sent to", "Mail subject", "Mail body", etc.) of incoming or outgoing emails?
1 REPLY
Community Manager

Re: Trigger job based on contents of incoming/outgoing emails

Hi 
Create a main job, use tPOP to fetch emails from server and then read the mails with tFileInputMail, parse the contents and trigger another job using runIf connector based on the condition. eg:
tPOP
 |
onsubjobok
 |
tFileInputMail--main-tJavaRow--runIf--tRunJob
tJavaRow:
if(input_row.sent_from.equals("user@talend.com")){
globalMap.put("iscontinue",true);
}else{
globalMap.put("iscontinue",false);
}
set the condition of runIf link as:
(Boolean)globalMap.get("isContinue")
Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business