Mail relay: docs, agent guide, skills, changelog draft; test against the real service code; starter offers the mail service

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 20:53:38 +01:00
co-authored by Claude Fable 5.2
parent 533f571d4d
commit dd3792cbc7
25 changed files with 991 additions and 167 deletions
+9 -2
View File
@@ -3,7 +3,7 @@
External service keys edited in the admin panel, plus a notice for the editor when one of them
stops working — no crons, no polling: the server records the status when it actually uses an integration.
Related: [email.md](./email.md) (SMTP/Graph), [turnstile.md](./turnstile.md),
Related: [email.md](./email.md) (the mail service, SMTP, Graph), [turnstile.md](./turnstile.md),
[analytics.md](./analytics.md), [seo.md](./seo.md) (IndexNow), [deployment.md](./deployment.md).
## The `site-integrations` global (panel: Settings → Site integrations)
@@ -14,7 +14,7 @@ Currently always added by the plugin. Tabs (unnamed — flat data, e.g. `ga4Meas
|---|---|
| Analytics | `ga4MeasurementId`, `gtmContainerId`, `metaPixelId`, `clarityProjectId`, `linkedInPartnerId`, `tiktokPixelId` |
| Spam protection | `turnstileSiteKey`, `turnstileSecretKey`, hidden `turnstileStatus` + banner |
| E-mail sending | `emailTransport` (`smtp` / `graph`), `smtpHost`, `smtpPort`, `smtpUser`, `smtpPassword`, `smtpFromAddress`, `smtpFromName`, test button, hidden `emailStatus` + banner |
| E-mail sending | the state block "How e-mails are sent" (`mailRelayStatus`, a `ui` field — nothing stored; absent with `mail: { relay: false }`), `emailTransport` (`smtp` = "Automatic" / `graph` = deprecated), `smtpHost`, `smtpPort`, `smtpUser`, `smtpPassword`, `smtpFromAddress`, `smtpFromName`, test button, hidden `emailStatus` + banner |
| IndexNow | `indexNowKey` (generated on first save) |
| More | fields from the `integrationsFields` option — only when given |
@@ -27,6 +27,8 @@ const integrations = await getSiteIntegrations<SiteIntegration>(payload) // ov
```
The "Send test" button (E-mail sending tab) calls `POST /api/ipal/test-email` (endpoint currently always added).
The state block above it reads `GET /api/iapl/mail-relay/status` and acts through `POST …/connect` and
`POST …/disconnect` (admin only; [email.md](./email.md) "The state block in the panel").
## Integration status — dashboard alert and tab banner
@@ -34,6 +36,10 @@ The "Send test" button (E-mail sending tab) calls `POST /api/ipal/test-email` (e
form (`turnstileStatus`) call `recordIntegrationStatus`. It writes only when the state changes,
or at most every 10 min while an error lasts; it never throws.
- **Changing keys in the admin panel** (Turnstile, `emailTransport` / `smtp*`) clears that integration's old status.
- **`emailStatus.code`** of a send through the Intecion mail service is one of the `relay-…` codes (`relay-pending`,
`relay-quota`, `relay-unreachable`, …), each with a text in the editor's language — the list and what to do:
[email.md](./email.md) "Status codes". The token of the mail service is **not** in this global: it lives in
`payload-kv` and no route answers with it.
- **`IntegrationAlerts`** (`@intecion/ipal-kit/admin`) — the plugin always wires it into
`admin.components.beforeDashboard`: a list of integrations in the `degraded` state + Turnstile key
problems + an "Open Site integrations" link (from `adminRoute`). When everything works it renders nothing.
@@ -75,6 +81,7 @@ The dashboard `IntegrationAlerts` checks only `emailStatus` and `turnstileStatus
## Turn off / override
- The mail service's state block and its four routes: `iapl({ mail: { relay: false } })`.
- The `site-integrations` global, the `/api/ipal/test-email` endpoint and `IntegrationAlerts` on the dashboard
are **currently always added** — there is no option to turn them off. Workaround: a project plugin
wired after `iapl()` that removes / replaces the entry in `config.globals`, `config.endpoints` or