Hi All,
How can we read the name of the attachments in the mail when working on communication mining. What should i do to include the name of the attachments in the stream. Please help !!!
Hi @harshit.gupta,
AFAIK synchronizing attachments (actually uploading them to CM buckets) is only available with MS Exchange integration as one of the message upload methods. There’s a switch to enable it:
After that, when getting stream results, either via API or Activities, you should find a list property ‘attachments’ (it’s empty on this screenshot, but if there are any, it won’t):
That list will have your attachments details like file name, size and most important: attachment reference. This is an ID that you need to pass to ‘Get Attachment’ API endpoint or Studio Activity that has a similar name.
Not sure what API call returns, but Studio Activity will actually download the attachment to your Windows Temp folder and return you a path to the file that sits there. With path and file in hand, you can later do anything you need.
As an alternative, when using other upload methods rather than MS Exchange integration, I would suggest getting the attachment name, id, whatever you need, from email object properties and putting all that into string user properties that CM allows you to pass for every message you upload, regardless of the method you choose. This way you can always identify the attachments linked to a particular message, but you need to figure out a way to move attachments (files) around, e.g. put them into Orchestrator storage buckets, or whatever you want to do with them.
If you have more questions, reply below, I hope this helps.
Cheers
Tom