cancel
Showing results for 
Search instead for 
Did you mean: 

Using mail payload to create target file directory

Cortex2k
Active Participant
0 Kudos

Hi Folks

I have a scenario where I need to get email attachments and place them in a folder structure based on text written in the subject field of the original payload.

My current setup is:

Sender:

Mail adapter using PayloadSwapBean module in order to get the attached .csv file in the mails.


Receiver:

Plain File adapter currently pointing  to a specific destination.

I would like to use the Subject field from the original payload (MailMessage), but as I use the PayloadSwapBean, the payload is swapped to MailAttachment-1 in which I dont have subject information.

Now the question is: Is it possible to get this information and then use it in e.g Adapter Specific Message Attributes  of the receiver channel, AND still swap the payload to put the  attachment in the folder created?

Please let me know if something needs clarification

Thanks,

Chris

Accepted Solutions (1)

Accepted Solutions (1)

Harish
Active Contributor
0 Kudos

Hi Chris,

you pick the email and use the ASMA to read email subject. then you can use AF module to put email subject value to directory variable. then use the variable in receiver file adapter.

refer the below blog

regards,

Harish

Cortex2k
Active Participant
0 Kudos

Hi Harish

Great link. I think that will solve my scenario. In the meanwhile I have decided to go for another solution to my requirement, which makes the folder structure requirement obsolete.

Thanks for your input however. I will save that for another time 🙂

Best regards,

Chris

Answers (1)

Answers (1)

abhradeepbasu
Participant
0 Kudos

Chris,

Try with variable transport binding. Refer to the below lonk:

http://help.sap.com/saphelp_nwpi71/helpdata/en/23/c093409c663228e10000000a1550b0/content.htm

/A.B

Cortex2k
Active Participant
0 Kudos

Hi A.B

Thanks for the link. I have read it earlier, but I am still not sure how to bind everthing together.

Best regards,

Chris