by jon 

M365: Download and sort attachments

0 Comments

Managing email attachments can be a time-consuming task, especially if you receive many emails with important files.

This n8n workflow automates downloading attachments from Microsoft Outlook and saving them to specific folders based on the sender's email. It also uploads these attachments to Nextcloud. Here's how it works and how you can adapt it to your needs.

Workflow Overview

  1. Microsoft Outlook Trigger: Monitors your Outlook inbox for emails with attachments.
  2. Split Out Attachments: Separates the attachments from each email.
  3. Map Sender Email to Target Folder: Determines the target folder based on the sender's email.
  4. Write Attachment to Disk: Saves the attachment to a local folder.
  5. Upload to Nextcloud: Uploads the attachment to Nextcloud.

Adapting the Workflow to Your Needs

  1. Modify Email Polling Frequency:

    • Adjust the pollTimes parameter in the Microsoft Outlook Trigger node to change how often your inbox is checked.
  2. Customize Folder Mapping:

    • Update the folderMapping object in the JavaScript code of the Map Sender Email to Target Folder node to add more mappings or change existing ones.
  3. Change Local Save Path:

    • Modify the fileName parameter in the Write Attachment to Disk node to save attachments to a different local directory.
  4. Update Nextcloud Upload Path:

    • Change the path parameter in the Upload to Nextcloud node to upload attachments to different folders in your Nextcloud account.

By following this guide, you can streamline the process of handling email attachments, saving time and reducing manual effort.

Adjust the workflow as needed to fit your specific use case, ensuring a more efficient email management system.

Alternative sorting rules

If you need to sort the attachments based on keywords in the subject or even using AI, here's a workflow template to pick and choose from:

About the author 

jon

With over 20 years of experience in software development, product management, and business leadership, I specialize in optimizing and scaling business processes through innovative automation and advanced AI technologies.

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
Subscribe to get the latest updates