I've been working with a customer to figure out a way to email enable lists or libraries in Office 365/SharePoint Online. After deciding that a third party tool wasn't ideal, we looked at Logic Apps and Microsoft Flow. I found a few articles but they were out of date and not fully functional.
I'm writing this article to help fill the gaps until more funtionality is available for the SharePoint connectors and also to help clear up some of the things that took a bit of meddling to figure out.
Here are the requirements and some comments on current restrictions. Restrictions apply to connectors for both Logic apps and Microsoft Flow as of 01/08/2017. If you are looking at this in September or beyond have a search around to see what Microsoft have implemented since this post.
Recieve an email to an email address. Once email received, it is picked up and processed into a document library
The reason we ended up using a document library instead of a list is currently there is no way to add attachments to a list item (this should come eventually), which means we can't add the BODY content as an attachment or the attachments in the email as attachments.
Ideally we wanted to grab the whole email, attachments and all and add the .msg file to the document library. This isn't possible (but also on the radar from Microsoft).
To work around this we will be creating a .txt file for all of the email details (from, subject, date received, has attachments?, body) and additional files for each attachment.
Add metadata to the item for email fields
Sadly this isn't currently possible but it IS on the radar for development. You can only add metadata to a list item and not a document library. Adding metadata to list items also isn't ideal due to the fact you are restricted to 255 characters for string fields, not enough for the BODY content.
For now the workaround is to pass all of these fields into the document we create in the document library.
I'll cover how to achieve this in both logic apps and flow, though both have pretty similar steps. NOTE: Flow is built ontop of Logic Apps, they are fairly similar but FLOW is accesable from SharePoint and more power user focused, where Logic Apps is more developer focused.
Instructions for building mail enabled libraries in Office 365
I have split Logic Apps and Microsoft Flow into two seperate posts to reduce size
I noticed over night that random spam from Microsoft processes made it's way into my document library. You may want to trigger the email received action based on a specific folder and route emails that match criteria to the folder.