Here, let us look how to configure Microsoft Flow for sending mails with Office 365 SharePoint library files as attachments.
Imagine there is a requirement of sending mails with SharePoint library files as attachments, if a file/item is created/uploaded. Previously we were creating tools for such requirements. Unfortunately, SharePoint designer doesn’t provide option for attaching files in the mails, in the configurations.
Microsoft Flow provides a solution for the above requirement. The solution just includes few configuration steps, which might take one or two minutes of your effort
Use Case: Whenever a file is created in the folder, send out a mail notification with the uploaded file as attachment to a particular mail box.
The following steps shows the detailed configuration steps.
Create a Microsoft Flow with a blank template as base.
Select SharePoint connector, search and select “When a file is created in a folder” trigger. In the trigger, Provide the site address URL and select the necessary library/folder path.
Add an action and select “Office 365 Outlook”. Search and select “Office 365 outlook – Send an email” option. In the action selected, provide the necessary input details, such as
Attachment Name – Select the file name from the trigger using dynamic content option.
Attachment Content – Select the file content from the trigger using dynamic content.
Save the flow.
Test the MS Flow for Emails with Attachments:
Navigate to the SharePoint portal library (the library which is being selected during the flow configuration). Upload some file to the library. After few seconds, you come back to the Microsoft Flow portal, to see the flow run details.
The following snapshot shows the mail being triggered with the attachment.