Mail relay: the built-in client for the Intecion Notifications Webservice

Transport, enrolment with the confirm route, token and state in payload-kv, rotation,
the panel's state block, doctor rules, the fake service and the copied contract 1.5.0.
Tests against the contract's runner and the fake. Docs and HTTP tests follow.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-11-25 20:29:46 +01:00
co-authored by Claude Fable 5.2
parent 9efd86a06f
commit ea9703f8e3
97 changed files with 7720 additions and 48 deletions
+25 -1
View File
@@ -19,6 +19,7 @@ import type { ConsentLogOptions } from './modules/consent/consentLog.js'
import type { CookieScannerOptions } from './modules/consent/scanner/types.js'
import type { ContentOption } from './modules/content/types.js'
import type { DoctorEndpointOptions } from './modules/doctor/status.js'
import type { RelayOptions } from './modules/email/relay/options.js'
import type { FormsOption } from './modules/forms/types.js'
import type { RevalidatePathFn } from './modules/hooks/buildRevalidateHook.js'
import type { I18nConfig } from './modules/i18n/types.js'
@@ -178,6 +179,22 @@ export type IaplOptions = {
*/
lightbox?: boolean
/**
* E-mail (docs/email.md). A site with no SMTP server in Site integrations sends through the
* Intecion Notifications Webservice: it enrols by itself on its first send (an outbound call with
* the site's host and the plugin version) and gets its own token through the public route
* `POST /api/iapl/mail-relay/confirm`. A site with SMTP filled in never contacts the service.
*
* - `relay: false` — no enrolment, no outbound call, no confirm route, no state block in the
* panel: SMTP (or Graph) only, as before 1.17.0.
* - `relay: { … }` — the service's address (a relay of your own), the site's host, manual
* enrolment, a token from elsewhere, the sender name, the limit on account e-mails.
* - `graphDeprecationWarning: false` — no start-log warning while the site still uses the
* deprecated Microsoft Graph transport.
* `mailAdapter({ relay })` overrides `relay` for that adapter.
*/
mail?: MailOptions
/**
* System-page assignments (homepage, privacy, cookies) in SiteSettings.
* Provide the slug of the client's Pages collection to enable.
@@ -200,7 +217,6 @@ export type IaplOptions = {
* over `seo.searchSettings`.
*/
searchSettings?: ((defaults: Field[]) => Field[]) | false
/**
* SEO — adds meta fields to chosen collections (via @payloadcms/plugin-seo)
* and enables locale-aware metadata helpers.
@@ -222,6 +238,7 @@ export type IaplOptions = {
* follows the new server. docs/security.md "Stored secrets".
*/
secrets?: { reenterOnChange?: false; writeOnly?: false }
seo?: SeoOption
/** Additional fields injected into SiteSettings global */
@@ -437,3 +454,10 @@ export type ThemeOptions = {
/** @deprecated The name before 1.17.0; the same type as `IaplOptions`. Removed in 2.0. */
export type IpalOptions = IaplOptions
export type MailOptions = {
/** `false` silences the one warning per process start of a site on Microsoft Graph (deprecated, removed in 2.0). */
graphDeprecationWarning?: boolean
/** The Intecion Notifications Webservice. Default on; `false` switches it off. */
relay?: false | RelayOptions
}