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

# CE Settings

> Configure module-level Community Engagement settings for contacts, leads, and crisis on-call at /ce/settings.

The CE Settings screen provides module-level configuration for the Community Engagement core and is accessible at `/ce/settings`.

## Overview

The CE Settings screen loads the current module settings via `useCEModuleSettings`. The primary card, titled "Module Configuration," contains a `CESettingsForm` described as customizing lead management, contact handling, and engagement settings. A separate `CrisisOnCallSettingsCard` is rendered below. Users can launch a guided tour of the settings page via a Help button (tour ID `ce-settings-tour`). Settings are persisted via an upsert operation on form submission.

## Who it's for

Required permission: `ce.admin` (route-level gate).

## Before you start

* You need the `ce.admin` permission.
* CE module settings must be loadable; a loading skeleton is shown during fetch and an error state is shown on failure.

## Steps

<Steps>
  <Step title="Open CE Settings">Navigate to `/ce/settings` from the Community Engagement navigation.</Step>
  <Step title="Configure module settings">Adjust fields in the Module Configuration card (lead management, contact handling, and engagement settings) and click Save.</Step>
  <Step title="Configure crisis on-call settings">Scroll to the Crisis On-Call Settings card and update on-call configuration as needed.</Step>
  <Step title="Take the guided tour (optional)">Click the Help button to start the `ce-settings-tour` guided tour of the settings page.</Step>
</Steps>

## Follow-up task → M365 calendar push

When enabled, creating a follow-up task from a CE activity also pushes a one-way, PHI-safe event into a Microsoft 365 (Outlook) calendar. The assigned coordinator then sees the follow-up alongside their other appointments. The original task always remains the source of truth — if the calendar push fails, the task is still created (fail-open).

This is configured per organization on the Module Configuration card and is **off by default**.

| Setting                                | Values                                       | Description                                                                                                                       |
| -------------------------------------- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `m365_calendar_push_enabled`           | `true` / `false`                             | Master switch. Default `false`. When off, no calendar event is pushed.                                                            |
| `m365_calendar_push_auth_mode`         | `delegated` / `application`                  | `delegated` writes to the assignee's own connected M365 calendar. `application` uses the org's Entra app to write to any mailbox. |
| `m365_calendar_push_recipient_mode`    | `assigned_coordinator` / `per_task_override` | `assigned_coordinator` uses the task assignee's email. `per_task_override` accepts an explicit email at task-create time.         |
| `m365_calendar_push_default_recipient` | email (optional)                             | Fallback mailbox when no coordinator or override resolves. Leave blank to skip the push instead of falling back.                  |

The pushed event contains only a follow-up identifier and a deep link back into Encore — never contact PHI. Each push is recorded in `ce_calendar_events` with a `source_type` of `pf_task` and the originating task ID so the calendar event can be traced back to the follow-up.

Prerequisites for `delegated` mode: the assignee must have an active Microsoft Outlook connection on [Calendar Connections](/ce/calendar-connections). For `application` mode, an Entra application registration with `Calendars.ReadWrite` (application) permission must be configured for the org.

## Key concepts

* **Module settings** — stored via `useCEModuleSettings` upsert; changes apply organization-wide.
* **Crisis on-call** — managed via `CrisisOnCallSettingsCard`; SME: confirm escalation tiers and contact configuration.
* **Guided tour** — triggered via `?tour=ce-settings-tour` URL parameter or the Help button.
* **M365 calendar push** — additive, default-off, fail-open; the follow-up task is created regardless of whether the calendar write succeeds.

## Related

<Columns cols={2}>
  <Card title="Community Engagement" icon="bullhorn" href="/ce/overview">
    Community Engagement core overview.
  </Card>

  <Card title="Governance & parity" icon="scale-balanced" href="/governance/index">
    Documentation coverage and governance.
  </Card>
</Columns>

<Note>
  This page documents shipped product behavior. It is not medical, legal, or
  billing advice. Verify against your organization's policies and applicable
  regulations before using it for clinical, compliance, or billing decisions.
  Protected health information (PHI) shown in the product is governed by your
  tenant's access controls and is never exposed in this documentation.
</Note>

<Accordion title="Documentation sources">
  * src/routes/ce.tsx
  * src/cores/ce/pages/CESettingsPage.tsx
  * src/cores/ce/hooks/useCESettings.ts
  * supabase/migrations/20260614120000\_ce73\_m365\_push\_settings\_and\_calendar\_event\_source.sql
</Accordion>
