Send an automatic reply to certain senders when email is sent to a Shared Mailbox with Power Automate
I have been intending to play around with Power Automate for a long time and finally had a problem where Power Automate would be the solution.
I have a shared mailbox and I needed to send a customized automatic response to certain sending domains. Instead of converting the Shared Mailbox, enabling the account, setting a password and then logging in to set client side Outlook rules, I decided to try and use Power Automate.
The Problem
Emails are sent to a particular Shared Mailbox. For a particular sending domain, we do not want them emailing this Shared Mailbox. But we want to give them guidance on where to go or rather, where they should be sending their email.
Create a new Automated cloud flow
Creating the trigger
First, log into you Power Automate environment by going to office.com --> Apps --> All Apps and find Power Automate or go to make.powerautomate.com. On the left menu, click +Create
Give your flow a name and choose your flow's trigger. We are going to select the Office 365 Outlook type trigger "When a new email arrives in a Shared Mailbox (V2)" and then click Create.
We can now start building our flow with the trigger we just selected. For this trigger, we are going to input the email address for the Shared Mailbox and leave the rest defaulted.
Building the "Condition" Action Step
Now we need to add the "brains" of the flow; the Condition step. Click on "New Step" and under Actions, we will select "Condition" of type "Control".
There are a few parts to the Condition step that we need to configure for the logic of our flow. Our bounce back email should only be sent to a specific sending domain. For our condition, we will select the "From" dynamic content value which is one of several output values from our trigger.
We will select the "contains" operator and input the string of the sending domain for which we want our bounce back message to send.
领英推荐
If the email received in the Shared Mailbox is sent from someone at @sendingdomain.com, we need to send a message.
Let's select "Add an action" under the "If yes" branch of the condition and search for the "Send an email (V2)" Office 365 Outlook action.
Select the "To" field, select Dynamic content and select "From" in the list. We want to use the output from the initial trigger and send our bounce back email to the user who sent the email - in other words, the email address in the "From" field which in our exmaple here would have been someone from @sendingdomain.com.
Select the Subject field and again, select dynamic content and select the "Subject" from he list. This will make the bounce back email contain the same subject used by the sender. Specifuthe body of your email and add hyperlinks or other dynamic content.
Sending the bounce back email as the Shared Mailbox
Select "Show advanced options" and select the "From (Send as)" field.
NOTE, YOU MUST HAVE "Send As" PERMISSIONS ON THE SHARED MAILBOX FOR THIS.
If you do not have Send As permission on the mailbox, the email will fail to send. If you leave this field blank, the email will show your email address (author of the flow).
Save your flow and then let's Test!
Click on the "Manually" radio button and then click Test. Send an email to the shared mailbox from the specified sending domain. You will see status of test and be able to see the output of you flow!
Check Run History of your flow
Click on "My flows" on the left menu and select your newly created flow and under 28-day run history, click on one of them.
When the instance opens, expand the Condition and "Expression Result" will equal True anytime someone from "@sendingdomain.com" sends an email to the shared mailbox.
You can also expand the action "Send an email (V2)" and view the raw inputs which will show the information received by the original Automated Trigger at the top of the flow
System Engineer at Tata Consultancy Services | SharePoint Developer | Microsoft Certified: Power Platform Developer Associate | TCS Digital
3 个月Hi Anton W. Your workflow only works if auto reply is not configure on sender email. Let say we have two mailbox "A" & "B" on both auto reply configure so when A send email to B as soon as B received email it will sent auto reply to A. Once A received auto reply from B it will sent an auto reply email to B. Each one will send email as soon as they received any email or auto reply email. How we can avoid this so that our flow will only send email 1 time not go on infinite loop