Shared Mailbox Monitor and Router
Monitors a shared mailbox for new emails and routes them to the appropriate team member based on keywords in the subject or body. Logs all incoming emails to SharePoint for tracking.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow watches a shared Outlook mailbox and automatically triages incoming messages by inspecting the subject and body for routing keywords. Each new email is first logged to a SharePoint tracking list, then forwarded to the appropriate team member (Sales, Finance, Support, Business Dev, or a general fallback) based on a Switch evaluation. After forwarding, the SharePoint log entry is updated with the routed recipient and a 'Routed' status, and an optional Teams post broadcasts a short summary to a #mailbox-activity channel. Together these steps give the team an audit trail of every message, a deterministic routing decision, and lightweight visibility for anyone watching the channel.
Use Case
Use this flow when a single shared mailbox receives a high volume of email that needs to be split among several teams without manual triage. It is well suited for general intake mailboxes such as info@, hello@, or contact@ addresses where different sender intents map to different downstream owners. The keyword-based Switch is intentionally simple — it lets a Power Platform admin add or change routes without rebuilding the flow, and the SharePoint log doubles as a metrics source for response-time reporting.
The flow is ideal for teams that:
- Operations teams managing a shared intake mailbox
- Organizations that need an auditable log of inbound email
- Teams that want lightweight keyword-based routing without a full ticketing system
- Scenarios where Teams notifications are useful for shared visibility
Flow Architecture
When a new email arrives in a shared mailbox
When a new email arrives in a shared mailbox (V2) — Office 365 OutlookFires whenever a new message lands in the configured shared mailbox. Set the Original Mailbox Address to the shared address you want to monitor (e.g. shared@yourcompany.com).
Log to SharePoint
Create item — SharePointCreates a row in the 'Shared Mailbox Log' list capturing From, Subject, Received Date, and Body Preview. Status is initialized to 'New' so the entry can be updated later in the run.
Route Based on Keywords
Switch — ControlEvaluates the subject and body of the incoming email and selects a routing branch. Cases: 'order' routes to Sales, 'invoice' routes to Finance, 'support' routes to Support, 'partnership' routes to Business Dev. The Default case routes to a general inbox so nothing is dropped.
Forward Email
Forward an email (V2) — Office 365 OutlookForwards the original message to the recipient chosen by the Switch and adds a short note: 'Auto-routed from shared mailbox based on content analysis.'
Update SharePoint
Update item — SharePointUpdates the log row created in Step 1 with the Routed To value and sets Status to 'Routed' so the log reflects the final disposition.
Post Summary (optional)
Post message in a chat or channel — Microsoft TeamsPosts a short summary of the new email and routing decision into the #mailbox-activity channel. This step is optional and can be removed if Teams notifications are not desired.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_SharedMailboxAddress | String | <configure> | Email address of the shared mailbox to monitor (e.g. shared@yourcompany.com). Set this to the mailbox the trigger should watch. |
| flowlibs_LogListName | String | Shared Mailbox Log | Display name of the SharePoint list used to log incoming emails and routing outcomes. |
| flowlibs_TeamsChannelEnabled | Yes/No | Yes | Controls whether the optional Teams summary post runs. Set to No to disable channel notifications. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Office 365 Outlook | shared_office365 | OnNewEmailFromSharedMailboxV2 (trigger) ForwardEmailV2 |
| SharePoint | shared_sharepointonline | PostItem PatchFileItem |
| Microsoft Teams | shared_teams | PostMessageToChannelV3 (optional) |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Promote routing keywords to a config list
- Move the Switch case strings ('order', 'invoice', 'support', 'partnership') out of the flow and into a SharePoint configuration list or environment variables, so non-developers can add or rename routes without editing the flow.
- Add an escalation branch for unmatched email
- Replace the Default case 'Forward to general inbox' with an explicit escalation path that flags the SharePoint log row for review and (optionally) notifies a lead in Teams. This makes unrouted email visible instead of silent.
- Track response time
- Add a 'Responded Date' column to the SharePoint list and a second flow (or a manual trigger) that timestamps it when the routed owner replies. The log then doubles as a response-time data source.
- Use multiple contains() checks for accuracy
- Instead of a single Switch, use a chain of If conditions that combine contains() checks on both subject and body — this catches keyword variations and reduces misrouting on edge cases.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.