Its 2021 and Why is email still the absolute bane of my life! – I seem to ask myself this on a weekly basis

I often feel like by a Friday my inbox has so much in it I cant face sorting it out and then once in a while i end up biting the bullet and sorting it. i know there are many theories like clean inbox and stuff but actually im not convinced any of them really do what I want.

I think the problem is that everything in outlook is based off events like email read or email received so if you get a rule not quite right then you lose an important email or you end up with so loads in your inbox and then you have to sort it. Ive looked at a few 3rd party products and non quite do what I want so ive decided while off and bored that I will knock something up with Power Automate to make my life easier.

My Requirements

My email situation is made more complicated by being a consultant so I have email accounts with customers and my own email account where I get email from a number of customers and also some personal and community email. I need to put together different flows for each scenario and in the respective organisations tenant.

Email for Customer

To be honest the customer scenario isnt that complicated for me. What I want to do is:

  • Run a job each night after work
  • Any time I flag an email move it to a flagged folder because its important and I know I need to do something with it
  • Copy all of the email I have read to a read folder so I can get them if needed and search, etc
  • Leave my inbox with just any email I havent yet read in it so at the start of tomorrow I can focus on what I need to do

Personal Email

My personal email is more complicated and also I dont think I want to run the jobs automatically, I want to run a job on demand. What I want to do is:

  • Run a job on demand
  • Any emails that I havent read yet, leave in the inbox for me to read when done
  • For emails I have read:
    • Any emails that have a domain in a list I specify then I want to put them in the bin
    • Any emails from specific list of email addresses I want to move them to a read folder
    • Any email addresses from specific domains which belong to customer then move them into a specific folder for that customer

Ill come back to the personal email solution in a part 2 blog post, but for now we will look at how I implemented part 1 for email on one of my customers tenants.

Email Structure

I created a basic folder structure in my inbox. You can see below

  • 00 Not Read = This is a temp folder you will see discussed in my flow later
  • 01 TODO = This is a folder I use to put any emails I flag for follow up
  • 02 Read = This is the folder I move all emails to at the end of the day if they have been read

Note within the Read folder there are some sub folders where I may choose to manually move stuff if I need to but in general I just let everything thats been read get moved to the the read folder.

Flagging Email

This bit is really easy, there is pretty much an out of the box template to do this. In your flow you can add the Outlook Office 365 trigger for an email being flagged and then you can use the move email action to move the email to your TODO folder. A nice quick and easy one.

Nightly Clean up Job

The requirements for my nightly clean up job are a little more complicated to implement because of the available features in the Office365 outlook connector. I will use the recurrence trigger to run every night and then I will loop over the inbox and move all of the unread emails to the Not Read folder and the read emails to the read folder.

At a high level the workflow looks like below:

Drilling down the first loop looks like the below.

The key thing with this loop is that you can get up to 25 emails at a time from a folder and in the inbox if we dont move everything out from the inbox then we will loop over it forever. We will loop until the email counter tells us there is nothing left in the inbox. We will call get emails on the inbox folder and then do a length expression on the result to see how many emails are returned. We will continue over this until all are processed.

length(body('Get_emails_(V3)')?['value'])

With each email we process we will then workout if its read or not and move it to the appropriate folder.

Finally I then loop over the not read folder exactly the same as I did earlier and move all of the unread emails back to the inbox. Like below

Limitations

The implementation for this is a bit more painful than id like to be due to the way the connectors work, and this is the main reason I have to move all of the unread emails to the unread folder and then move them back later when done. If I dont do this then I just keep getting the unread emails returned when querying the inbox.

Outcome

The outcome is that with 2 pretty simple flows I now have a very easy to manage process where all emails I flag get moved to the TODO folder so I know I need to take action on them and also at the end of the day all of my read emails get moved to the read folder so the next morning I dont come into this ever growing list of email I need to “sort”. From a morale perspective it feels much more like a fresh start each day.

In the next post Ill talk some more about how I am managing my personal email now.

 

Buy Me A Coffee