How to get email file attachments from the email event service?

Comments

6 comments

  • Avatar
    Sylvia Able

    Can anyone help with this issue?  I'm working with Ming to resolve this but our testing has hit a wall.  Our use case is simple:  we want to extract attachments from incoming emails and then transfer them to a folder on another server for further processing.

    I will explain further what our issue is...

    We have an email event setup with the following settings...

    The event works fine and the email attachments are extracted to the Attachment Location which is a local file on the AgilePoint server:  

     

    The problem is that each time an email is processed, it creates a new unique folder for that email and puts the attachments from that email into the folder.

    We want all attachments to just go in one folder regardless of how many emails are processed.

    Is there a way to accomplish that?  Or is there an easy way that we can know these unique folder names to get to the extracted files and transfer them to their final destination?  Our preference is to have all attachments extracted to one folder.

    Thanks for any help you can provide!

    0
    Comment actions Permalink
  • Avatar
    Kumar E K

    Hi JamieBao\Sylvia Able

     

    Please check the below response if it helps what you are looking for.

    In E-mail Attribute Binding please use “File Attachment” option which helps to store the downloaded file absolute path(s). If you have more than one file the files are stored in semicolon separated value.

    Please provide a schema name or custom attribute name to store the “File Attachment” path(s). This can be used in the process to move to desired location upon mail is processed and process instance is kicked off.

     

     

    Thank you,

    Kumar E K

    1
    Comment actions Permalink
  • Avatar
    Sylvia Able

    Kumar,

    THanks so much for your response. I created a shared variable with the absolute folder path:

    And I set the File Attachment to this shared variable:

    But the email attachments were not downloaded at all and I didn't see any errors in  the process monitor.

    Did I specify something incorrectly?

    Thank you!

     

    0
    Comment actions Permalink
  • Avatar
    Kumar E K

    Hi Sylvia Able,

    You have to specify "Attachment Location" where to download the files. Please don't remove the "Attachment Location" from the configuration. "File Attachment" configuration is to store the downloaded file paths. Say you have configured "Attachment Location" as "C:\\Download", once the mail is process the attachments would be stored in "C:\\Download\mailid-guid\file.txt" and "C:\\Download\mailid-guid\file2.txt". To store these paths you can use "File Attachment" configuration give a process variable or form variable to store these absolute paths like downloadedfilepaths. Once the process is kicked off you can check the process data you would find a variable downloadedfilepaths with the value "C:\\Download\mailid-guid\file.txt;C:\\Download\mailid-guid\file2.txt". You can use these paths to transfer the files to desired location.

    Thanks,

    Kumar E K

    1
    Comment actions Permalink
  • Avatar
    Sylvia Able

    Ok, Sorry;  I misunderstood.  

    So, I created a process variable in my process called AttachmentFilePaths:

    And this is the configuration I put in my event:

     

    When the process runs, there's never a value in AttachmentFilePaths:

     

    And another question, once I have that semi-colon delimited string of file names, how would I be able to "loop" through that list of names in order to transfer them elsewhere?  Is there an easy way to put them into a repeating process variable that I can then loop through?

    Thank you for your help on this!

    0
    Comment actions Permalink
  • Avatar
    Kumar E K

    Hi Sylvia Able,

    As you created process filed the configuration value should be "/pd:AP/pd:processFields/pd:AttachmentFilePaths". You may check the response for above instance in the Process Variable Tab, there would be one filed name "AttachmentFilePaths" with the desired values.

    Please change the configuration to "/pd:AP/pd:processFields/pd:AttachmentFilePaths" to view/store the values in process filed schema. Looping you can use the condition activity to loop through all the paths, use update custom attribute for string manipulation to send one by path in the loop.

    Thanks,

    Kumar E K

    1
    Comment actions Permalink

Please sign in to leave a comment.