I’ve mentioned this many times, but sorting email is where productivity dies, even if you have a quick way to do it. There’s nothing better than having Power Automate doing all the work for you, so today, we’ll explore the “when a new email mentioning me arrives” trigger for Office 365.
Let’s see how to use it and how to find it.
Where to find it?
To find it, you can search for the “When a new email mentioning me arrives” trigger or go to the “Office 365 Outlook”:
Select “When a new email mentioning me arrives”:
Here’s what it looks like:
There are advanced options that we’ll explore below, but here’s how to activate them:
Here’s the advanced view.
Let’s check the “advanced” fields since they allow us to filter emails we don’t want to process.
There are a lot of fields that we can configure. Let’s look at them individually.
If you leave it blank, Power Automate will look at all incoming emails, but you can define different folders to trigger instead of the inbox. For example, you may have a folder where you send a pre-defined answer to the person that emails you while mentioning you or send you a notification when this happens. The folder is a great way to limit catching all emails that arrive mentioning you so that the Flow doesn’t fire for all emails, so be sure to define it if possible.
“To”, “CC”, “To or CC,” or “From”
These fields were a great idea from Microsoft when creating this trigger. Since we receive many emails, it doesn’t make sense for the trigger to fire each time we receive an email mentioning us. For example, we may only want a subset of the total emails or emails from specific co-workers. With these filters, we don’t need to add large “Condition” or “Switch” actions to filter the emails you want. The trigger does all the work for you.
Just so you know, the trigger will run only if at least one matches, so this is also good if you have substantial limitations on the number of Flows you can run a day.
To use it, separate the emails with “;”. You can have internal and external emails, but keep this field with only the email. When you copy emails from some email clients, you’ll have the name associated with it, so be sure to remove it.
Finally, I want to highlight the “To or CC” field. If you add an email to the “To” field or the “CC” field, the email must contain both for the Flow to trigger. But if you want either one, you can use the “To or CC” field.
The “importance” field is often ignored, but some organizations can have strict rules on how to use it. If yours is one of them, you can have a Flow that sends you a notification each time a “High” priority email arrives, for example. The available possibilities are:
Only with Attachments
For example, if you have a Flow that archives your attachments automatically, you may want to trigger Flows that have them. Having your Flow trigger only when a condition is satisfied makes your life easier because you don’t need to validate, for each email that arrives, if there’s an attachment or not.
Should the trigger include the attachment information or not? There is, however, something that you should know. Even if you enable this feature, Flow (at the time of writing this article) won’t fetch the attachments correctly. I go into detail in this article, but you need to know that you need to fetch the articles separately using the “Get email” action.
As with the other fields, we can filter the subject for a specific string, and the Flow will only trigger if that condition is met.
It’s essential to define what is an email “arriving”. It doesn’t need to be a new email or an email that drops in the inbox. We consider it as “arriving” any email that is moved to a folder, being automatically when it arrives in your inbox, or you move it to another folder. This is super important because it opens the doors to a lot of automation based on moving emails to folders.
This trigger will fire if the emails mention you in the body, so you’ll have access to all properties of that email in the following actions. For example, here’s how to access the email’s subject using a “Compose” action.
Notice that you don’t need to use the “Apply to each” action because you only have one email each time, meaning that if you receive multiple emails where you’re mentioned, your Flow will trigger once per email received.
Please remember that a mention is not the same as having your name. For example, if I write the following email, it won’t be considered a mention.
But the following is:
You need to use the “@“ character to display several suggestions that can be people from this email. Please be careful because some email clients will automatically add the email to the list of senders if it’s mentioned, so be sure you want that person to receive the email.
You can’t access emails in shared libraries. You can use the “When a new email arrives in a shared mailbox” trigger to catch emails, but then you need to check int email’s body to see if there’s a mention of you manually.
Also, some emails, like protected emails, could be skipped depending on your tenant configurations. If there’s any issue in the attachments or body of the email, the “When a new email mentioning me arrives” won’t trigger as well.
Here are some things to keep in mind.
Use the filters wisely
Using the filter fields is a fantastic way to trigger your Flow when the condition is met, limiting the number of times the Flow fires. But it’s important to know that the flow triggers only if all filters are met. Test your triggers and ensure they are firing when you want them. Any email that should be parsed but doesn’t fit the filters will be ignored, so it’s a hidden error since there are no error messages or warnings.
Name it correctly
The name is super important in this case since there are a lot of filters. Define in the name what you’re trying to achieve. Always build the name so that other people can understand what you are using without opening the action and checking the details.
Always add a comment
Adding a comment will also help avoid mistakes. Indicate what emails you want to fetch, the ones to ignore the exceptions, and the reasoning behind that. It’s essential to enable faster debugging when something goes wrong. Besides, it’s good to understand the mindset and requirements when building the Flow in case someone else is debugging or improving it.
Back to the Power Automate Trigger Reference.