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

# Website Utilities

> Contact Routing & Vocabulary Automation Workflows

## End-to-End Website Utilities Lifecycle

The Website Utilities module bridges internal administration with your public school website, orchestrating spam-protected parent-to-staff message routing with central office oversight and automating the dynamic Word of the Week vocabulary engine.

```mermaid theme={null}
flowchart TD
    subgraph ContactTrack["1. Website Contacts & Inquiry Routing"]
        C1["Manager curates Staff Contact Directory & Department Groups"]
        C2["Parent visits public /contact form on school website"]
        C3["Security Layer: Cloudflare Turnstile, Honeypot & Rate Limiting"]
        C4["StaffContact Notification Dispatched:<br/>• Direct email to Staff Member / Department<br/>• Carbon Copy (CC) to School Admin Office<br/>• Reply-To routed via School Office for quality assurance"]
        C1 --> C2 --> C3 --> C4
    end

    subgraph WordsTrack["2. Word of the Week Vocabulary Automation"]
        W1["Manager schedules vocabulary words with translations (show_from dates)"]
        W2["Weekly Stock Monitor checks future reserve (> 4 weeks needed)"]
        W3["Midnight Automated Rollover & Smart Cache Invalidation"]
        W4["RESTful JSON Endpoints feed live website widgets & digital signage"]
        W1 --> W2 --> W3 --> W4
    end

    ContactTrack --> AuditPhase["Governance, Logging & API Integration"]
    WordsTrack --> AuditPhase
```

***

## 1. Parent Inquiry Routing & Communication Workflow

To protect staff inboxes from spam while ensuring central administrative oversight of parent inquiries:

```mermaid theme={null}
flowchart LR
    Parent["Parent submits form at <code>/contact</code>"] --> BotCheck["Turnstile Bot & Honeypot Defence"]
    BotCheck --> EmailRouter["Cleverschool Notification Engine"]
    EmailRouter --> StaffInbox["Staff Member / Department Inbox"]
    EmailRouter --> OfficeInbox["School Admin Office Inbox (CC)"]
    StaffInbox -.->|Reply Action| OfficeRouting["Reply-To directed via School Office"]
```

### Step-by-Step Message Dispatch

1. A parent or visitor opens the school's public contact page (`/contact`).
2. They select a department (e.g. *Year 8 Pastoral Lead* or *Science Department*), enter their contact details, and author their message.
3. The submission passes automated bot validation (Cloudflare Turnstile token validation, honeypot traps, and a 1-minute rate limiter).
4. The system sends an email to the named staff member while automatically CCing the central school administrative inbox.
5. The `Reply-To` header directs initial responses via the school office, ensuring safeguarding oversight and tone consistency.

***

## 2. Staff Directory Management & Live User Auditing

In **Website Contacts** (`/website/contacts`), managers curate the published public directory:

> [tab] Departmental Groups
>
> * Organise staff into clear functional categories (e.g. *Senior Leadership*, *Pastoral Heads of Year*, *Admissions Team*).
> * Drag and drop rows to control presentation order in public website dropdown menus.

> [tab] Live User Status Auditing
>
> * User (Green): Email matches an active, verified staff account.
> * Not a user (Red): Email does not belong to any tenant user.
> * Archived user (Orange): Matches a former staff member whose account is archived.
> * Not a contact (Blue): Registered staff member not published on the website.

***

## 3. Word of the Week Scheduling & Cache Rollover

The vocabulary engine (`/website/words`) delivers automated weekly literacy terms to your public website:

**1. Schedule Vocabulary Terms**

Click **Add Word** and enter:

* **Word & Meaning**: Precise definition appropriate for the student age group.
* **Contextual Example**: An illustrative sentence demonstrating accurate usage.
* **Community Translations**: Translations in up to two community languages (e.g. Spanish, Urdu, Arabic).
* **Show From Date**: Scheduled Monday activation date.

**2. Automated Weekly Stock Monitoring**

A background job runs weekly. If fewer than **4 future weeks** of vocabulary words remain in the schedule, the system dispatches an alert (`WebsiteWordsReminder`) to Website Managers.

**3. Midnight Rollover & API Feed**

At midnight on each scheduled date, the caching engine rolls over automatically, serving the new term via the public JSON endpoint (`/website/words/current`).

***

## 4. Bulk Spreadsheet Operations

* **Contacts Import/Export**: Import complete staff directories from CSV or Excel spreadsheets with automated group assignment.
* **Vocabulary Bank Import**: Bulk-upload an entire academic year's worth of vocabulary terms in a single operation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.