> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Email Support in Dynamics 365

> Create Dynamics 365 incidents from every email handoff so your reps work them from the queue they already use.

Email handoffs flow into Dynamics 365 as <Tooltip tip="A Dataverse case record (entity: incident). Holds transcript, priority, owner, queue, and a linked contact.">incidents</Tooltip>. Reps work them from the Customer Service app in the queue you configure.

## Pre-requisites

<Warning>
  **Set up email forwarding into OpenCX first.** Dynamics handoff has nothing to route until emails reach OpenCX — see [Connect Email](/email/forwarding).
</Warning>

* **Email forwarding verified** — see [Connect Email](/email/forwarding).
* **Dynamics 365 credentials saved** — see [Connect to OpenCX](/integrations/dynamics-365/connect).

## How conversations land in Dynamics 365

```mermaid theme={"dark"}
flowchart LR
  A[Customer emails your address] --> B[AI answers by email]
  B --> C{AI can resolve?}
  C -- Yes --> D[Thread closes]
  C -- No --> E[Handoff triggers]
  E --> F[Incident created with transcript]
  F --> G[Rep picks up from queue]
```

## Setting up

<Steps>
  <Step title="Confirm email forwarding passes the connection test">
    In your [OpenCX dashboard](https://platform.open.cx/channels/configure/mail), the email channel status should show **Active**. If not, revisit [Connect Email](/email/forwarding).
  </Step>

  <Step title="Confirm Dynamics is connected">
    The **Dynamics 365** card on your [Settings → Integrations](https://platform.open.cx/settings/integrations) should show **Active**.
  </Step>

  <Step title="Set the default queue and priority">
    In the OpenCX Dynamics settings, set `default_queue_id` to the Dynamics queue your email team works from. Optionally set `default_owner_id` and `default_priority`.
  </Step>

  <Step title="Map any custom Dynamics fields">
    If your reps expect certain fields populated on every incident (e.g. `casetypecode`, `customerpriority`, a custom picklist), add them to `ticket_properties` as a JSON object. Use integer option-set values, not label text.
  </Step>

  <Step title="Trigger a test handoff">
    Email your forwarding address with a question the AI can't resolve. After the AI hands off, the incident appears in Dynamics in the configured queue with the transcript in the description.
  </Step>
</Steps>

## What the rep sees

* An **incident** in the Customer Service app, assigned to the queue you set.
* Title: `<classification> - <sender name or email>`.
* The full email thread rendered as the transcript inside the incident description, timestamped message by message.
* A linked contact by email — OpenCX either matches the sender's existing Dynamics contact or creates a new one.
* `Channel: email`, `Classification`, and `Sentiment` in the description header.

## Channel-specific details

<AccordionGroup>
  <Accordion title="One incident per handoff, not per email" icon="ticket">
    Every handoff creates a new incident. A single thread with multiple back-and-forth emails before handoff becomes one incident containing all those messages — reps don't see a split.
  </Accordion>

  <Accordion title="Attachments aren't copied to the incident" icon="paperclip">
    Files the customer attached to the email are visible on the OpenCX session (via the session link) but are not re-uploaded onto the Dynamics incident. Open the OpenCX session to pull the originals.
  </Accordion>

  <Accordion title="Contact dedupe by email" icon="address-card">
    OpenCX looks up `emailaddress1` before creating a contact. A repeat customer's history stays on one Dynamics contact record across multiple handoffs.
  </Accordion>

  <Accordion title="Reps reply inside Dynamics, not in OpenCX" icon="triangle-exclamation">
    Once the incident lands, the conversation continues inside Dynamics. OpenCX marks the session as handed off; messages the rep sends from Dynamics don't back-sync into the OpenCX session.
  </Accordion>
</AccordionGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="AI Email Support" icon="envelope" href="/email/introduction">
    Connect Email, forwarding rules, troubleshooting.
  </Card>

  <Card title="Conversations in Dynamics 365" icon="diagram-project" href="/integrations/dynamics-365/conversations">
    Incident contents, defaults, `ticket_properties`.
  </Card>

  <Card title="Connect to OpenCX" icon="plug" href="/integrations/dynamics-365/connect">
    Paste credentials and verify.
  </Card>

  <Card title="Troubleshooting" icon="wrench" href="/integrations/dynamics-365/troubleshooting">
    Incidents unassigned, 403 on create, `ticket_properties` rejected.
  </Card>
</CardGroup>
