{
  "schema_version": "1.0.0",
  "id": "outlook-mail-to-teams-channel",
  "title": "Route shared Outlook mail to the right Teams channel",
  "category": "email",
  "difficulty": "intermediate",
  "featured": false,
  "description": "Each email in a shared Outlook folder is classified by team and posted to that team's Microsoft Teams channel with a one-line summary.",
  "tags": [
    "email",
    "outlook",
    "microsoft-teams",
    "routing",
    "ai-triage"
  ],
  "apps": [
    "Microsoft Outlook",
    "AI by Zapier",
    "Formatter by Zapier",
    "Filter by Zapier",
    "Microsoft Teams"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 4 steps after the trigger",
      "Filter by Zapier",
      "Formatter by Zapier",
      "AI by Zapier"
    ]
  },
  "tasks": {
    "typical": 2,
    "max": 2
  },
  "trigger": {
    "app": "Microsoft Outlook",
    "event": "New Email in Folder",
    "kind": "polling",
    "title": "New email in the shared folder",
    "why": "Fires for each email in the shared folder the generic address delivers to.",
    "config": {
      "Folder": "Shared/Info inbox"
    },
    "outputs": [
      "message_id",
      "from_email",
      "from_name",
      "subject",
      "received_at",
      "body_preview",
      "body_text"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "classify",
      "kind": "ai",
      "app": "AI by Zapier",
      "event": "Analyze and Return Data",
      "title": "Decide which team owns it",
      "why": "Returns one team name from a fixed list plus a one-line summary for the channel post.",
      "fields": {
        "Model": "Default (fast)",
        "Instructions": "You route emails sent to a company's general address. Return team (exactly one of: sales, support, accounts, partnerships, ignore) and summary (one sentence under 25 words saying what the sender wants). Use ignore for spam and marketing newsletters.",
        "Input data": "From: {{trigger.from_name}} <{{trigger.from_email}}>\nSubject: {{trigger.subject}}\n\n{{trigger.body_text}}",
        "Output fields": "team, summary"
      },
      "outputs": [
        "team",
        "summary"
      ]
    },
    {
      "key": "channel",
      "kind": "formatter",
      "app": "Formatter by Zapier",
      "event": "Utilities",
      "title": "Map the team to a channel",
      "why": "A lookup table keeps channel names out of the AI prompt, so renaming a channel is a one-cell change.",
      "fields": {
        "Transform": "Lookup Table",
        "Lookup Key": "{{classify.team}}",
        "Lookup Table": {
          "sales": "Sales inbox",
          "support": "Support triage",
          "accounts": "Accounts payable",
          "partnerships": "Partnerships"
        },
        "Fallback Value": "Front desk"
      },
      "outputs": [
        "output"
      ]
    },
    {
      "key": "real",
      "kind": "filter",
      "app": "Filter by Zapier",
      "event": "Only continue if...",
      "title": "Skip spam and newsletters",
      "why": "Emails the model marked ignore stop here instead of cluttering a channel.",
      "conditions": [
        [
          {
            "field": "{{classify.team}}",
            "operator": "(Text) Does not exactly match",
            "value": "ignore"
          }
        ]
      ],
      "usually": true
    },
    {
      "key": "post",
      "kind": "action",
      "app": "Microsoft Teams",
      "event": "Send Channel Message",
      "title": "Post it to the team",
      "why": "The channel post carries the summary and sender so the team can claim it without opening the shared mailbox.",
      "fields": {
        "Team": "YOUR_TEAMS_TEAM",
        "Channel": "{{channel.output}}",
        "Message Text Format": "markdown",
        "Message Text": "**{{trigger.subject}}** from {{trigger.from_name}} ({{trigger.from_email}})\n\n{{classify.summary}}\n\nOpen the shared Info inbox to reply."
      },
      "outputs": [
        "id"
      ]
    }
  ]
}
