311 Email Handling Design Pattern in Dynamics 365

Core Principle

  • Customer = Contact
  • Properties and business accounts provide context, not identity.
  • Case is the system of record; email alone does not determine ownership.
  • Email activities may link to multiple contacts for history.
  • Case.Customer drives reply behavior and ownership.

Incoming Email Handling

  1. Check tracking header
    • If Case exists → link email to that Case
    • If no Case exists → create a new Case
  2. Identify matching contacts by email
    • Multiple contacts (guest or registered) may share the same email
    • Link email activity to all matching contacts
    • Do not deduplicate automatically
  3. Assign Case.Customer
    • Registered user → Case.Customer = Contact
    • Guest → create a new guest Contact → Case.Customer = guest
  4. Handle unresolved recipients
    • If a To, CC, or BCC address matches multiple contacts, leave the party list unresolved
    • Only single matches are resolved to a Contact or Account
    • Agents see the unresolved address but can manually link if necessary

Outgoing Email / Reply Handling

  • From / To fields: Show only Case.Customer (or original sender), not all linked contacts
  • Include tracking headers to associate replies with the correct Case
  • Replies from guests → create a new guest Contact if unmatched
  • Unresolved original recipients can optionally appear as text-only CC/BCC

Portal Implications

  • Guest submissions always create new guest Contacts
  • Registered users override guest creation for authenticated sessions
  • Portal access is driven by Case.Customer, never email alone

Reporting & Agent Experience

  • Cases provide centralized history and ownership
  • Email activity timeline includes all linked contacts for historical context
  • Agents work from Case-centric workflows, ensuring clean timelines
  • Property and business accounts provide context for analytics
  • Unresolved email addresses prevent confusing duplicate From/To lists

Implementation Tips

  1. Use tracking headers in outgoing emails to associate replies with the correct Case
  2. Filter multiple contacts in From/To/CC/BCC fields via:
    • Server-Side Plugin (Pre-Operation on SendEmail)
    • Power Automate / Flow (intercept outgoing email)
    • Leave unresolved if multiple matches exist
  3. Automatically select Case.Customer for reply To field
  4. Maintain history by linking emails to all matching contacts (timeline only)
  5. Handle guest replies: create new guest Contact if no Case exists

Benefits

  • Maintains identity integrity and privacy
  • Supports guest and registered submissions seamlessly
  • Handles duplicate email addresses safely
  • Prevents confusing recipient lists for agents and customers
  • Enables scalable, Microsoft-aligned operations
  • Preserves full email history while ensuring clean reply behavior

Key Takeaway

In 311 systems, cases own the workflow, contacts own identity, and emails are activities linked to all matching contacts. Case.Customer drives reply behavior, while unresolved recipients preserve email integrity without confusing agents. Property and business accounts provide context, ensuring a secure, scalable, and compliant Dynamics 365 solution.