Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
We have a simple requirement to pick a file from a folder and send it as an email attachment. Once the email with the attachment is sent, then we would like to move the file to a different location using 'tFileCopy' . My problem, is I only get emails without an attachment first, and later on, on an intermittent basis receive one more email with an attachment.
tFIleList ---> tSendEMail
If condition to trigger email only when there is a file ((Integer)globalMap.get("tFileList_2_NB_FILE"))!=0
tSendEmail:
tFileCopy:
Make sure the file is sent as attachment before it is removed, I would suggest you to move tFileCopy after tSendMail component, eg:
tFileList-iterate--tSendMail--oncomponentok--tFileCopy.
Hi,
TfileList-->iterate link -->tJava with this code: globalMap.put("filePath",(String)globalMap.get("tFileList_2_CURRENT_FILEPATH"));
followed by two trigger links
after the tjava one for send mail an other for file copy with this condition (String)globalMap.get("filePath") != null
and you use (String)globalMap.get("filePath") in the two components.
Maybe you don't need an itermediary variable (here filePath) and you can use (String)globalMap.get("tFileList_2_CURRENT_FILEPATH") everywhere.
Send me Love and Kudos
Make sure the file is sent as attachment before it is removed, I would suggest you to move tFileCopy after tSendMail component, eg:
tFileList-iterate--tSendMail--oncomponentok--tFileCopy.
Hi @Shicong Hong Thanks it worked as a charm.
Thanks @guenneguez jeremy for the response. I couldn't try your solution, but has helped me for implementing a other requirement 🙂