This deployment guide is designed to help admins effectively deploy the Asset & Inventory Management (AIM) app to their environment. It provides step-by-step instructions and information about deploying the app in the environment.
This article aims to outline the process for setting up incoming email functionality in SharePoint Online. This feature will help you receive incoming emails with attachments to the SharePoint document library.
The Incoming email functionality allows the SharePoint sites to accept emails and store them in lists and libraries. This feature used the local SMTP server to provide this function. However, with Office 365, this feature has been deprecated.
This helps you store the mail contents sent to other recipients in SharePoint libraries without uploading the contents manually.
In this article, we help you achieve that functionality using a Shared Mailbox and a Power Automate flow, with a specific set of features:
5. Specify the desired name (we have named it Save emails to Document Library) and under the triggers, select When a new email arrives in a shared mailbox (V2) (Office 365 Outlook). This will trigger the flow as soon as an item is created in our Shared Mailbox.
6. In the trigger, specify the Shared Mailbox alias (IncomingMails) that we will be used to receive Incoming emails for the SharePoint document library.
7. Initiate the following variables, which will be used further in the flow for calculations.
2. Subject – This will be used to create a folder in the document library to store the email and the attachments.
3. InvalidCharacters – This will be used to clean the Subject with any special characters to create a folder name
4. Temp – This will be used to store the subject value temporarily until the special characters have been removed in the foreach loop
8. In the next step, we remove the invalid characters from the mail subject, which will further be used to create a folder in the library.
The following expressions have been used in the above step.
2. Set Temp variable
3. Set subject variable after removal of invalid characters
9. In the next step, we add a condition to allow the processing of emails received from specific domains. This will ensure we filter out any unwanted emails.
10. In the next step, we filter out emails that do not have attachments.
Expression: @triggerBody()?['HasAttachment']
11. In the next step, we further process the emails that have attachments.
12. We first export the contents of the email using the Export email (v2) action. This will be used to upload the email contents to the document library.
Expression: @{triggerBody()?['Id']}
13. The next step is to create a folder in the document library using the subject as the name.
Expression: @{variables('Subject')}
13. Change the text from "Button" to "Create Single Person."
14. The next step is to send an email to the admin in case of the previous step of folder creation failure. This will have a run after configuration as below. The content of the email can be customized as per requirements.
Go to the Send an email notification settings – New Folder Failed step and then click on Configure run after. Uncheck all options and select has failed. This will ensure that the email will be triggered only when the create folder action fails.
15. The next step is to create the eml file in the Subject named folder created earlier.
Expressions:
This will also have a run after configuration to run only when the previous step is skipped. This will ensure that if the new folder creation fails and the email notification is triggered, then create eml file will not be triggered since the folder creation had failed earlier.
16. The next step is again to send an email to the admin in case of the previous eml file creation failure. The contents of the email can be customized as per requirements.
This will run after configuration as below to ensure that the email will be triggered only when the create eml file action fails.
17. The next step is to update the properties of the eml file created in the previous step.
Expressions:
This step will run after configuration as below to ensure it will be triggered only when the previous step is skipped. This will ensure that if the new eml file creation fails and the email notification is triggered, then create update file properties of eml file will not be triggered since the eml file creation had failed earlier.
18. In the next step, we check-in and publish a major version of the eml file created in the earlier steps. This will make it visible to authorized users.
Expressions:
19. The next step is to use the Apply to each action. This will loop through each attachment in the email and save it in the same Subject named folder created earlier.
Expression: @{triggerBody()?['Attachments']}
20. The next step is to create a file from the attachment in the Subject named folder created earlier.
Expressions:
21. The next is to send an email to the admin in case of the previous step of attachment file creation failure. This will have a run after configuration as below. The contents of the email can be customized as per requirements.
Go to the settings on the Send an email notification – file attachment Failed step and then click on Configure run after. Uncheck all options and select has failed. This will ensure that the email will be triggered only when the create attachment file action fails.
22. The next step is to update the properties of the attachment file created in the previous step.
Expressions:
This step will run after configuration as below to ensure it will be triggered only when the previous step is skipped. This will ensure that if the new attachment file creation fails and the email notification is triggered, then create update file properties of the attachment file will not be triggered since the attachment file creation had failed earlier.
23. In the next step, we check-in and publish a major version of the attachment file created in the earlier steps. This will make it visible to authorized users.
Expressions:
The above steps helped us achieve the Incoming email functionality that allows the SharePoint sites to accept emails and store them in lists and libraries.
The Power Automate flow has the following features.
This deployment guide is designed to help admins effectively deploy the Asset & Inventory Management (AIM) app to their environment. It provides step-by-step instructions and information about deploying the app in the environment.
This deployment guide is designed to help admins effectively deploy the Starfleet Stash app to their environment. It provides step-by-step instructions and information about deploying the app in the environment.
In today's fast-paced and ever-changing business landscape, companies are constantly looking for ways to optimize their processes, reduce costs, and increase efficiency. The Microsoft Power Platform offers a range of solutions that can help businesses achieve these goals.