- default.htm ports WinterCMS's default layout: wrapper, header row with
the Branding logo (or the site name), the inner-body card and a
copyright footer; its text wrapper ends with the footer
- built-in header and footer partials (logo/body/url, body)
- layouts get siteName (Branding site name, else the display name of
mail.from) and year; Brand.SiteName and migration
202611130002_mail_brand_site_name
- cabana Branding form gets site_name (trimmed, max 255), mapped into the
Branding preview draft; en/pl copy; img.logo brand CSS
- 35-06 Task 1 (G-35-8)
Gap G-35-1 (supersedes D-05; D-06 reset and D-07 drift per locale):
- the templates list keeps one row per template (the base row, or the
lowest variant when only variants ship) with a Customized locales
column (Default, then locale codes, at most three then +N);
- row states and the status filter aggregate over the template's
locale versions; the locale filter is removed;
- a not-customized locale without a file shows the base row's current
subject, body and layout; its info partial says so, its file version
compares with the base file, and Reset returns it to the base file
(postcard.ResetOverride accepts a fallback-locale code);
- copy: mail.template.customized_locales, mail.info_locale_default,
mail.info_locale_fallback (en/pl);
- tests: TestMailScreensSmoke/locales_list, templates and drift updated,
TestMailDrift on the grouped row, TestMailTemplateFilterScopes.
Gap G-35-1 (supersedes D-05), tracer slice:
- postcard: migration 202611130001_mail_template_base_code (base_code
column and index); SyncIndex writes base_code; EnsureLocaleRows creates
the <template>-<locale> rows of locales that ship no file; TemplateBase
and Catalog.TemplateFor; send, preview and validation resolve a missing
<template>-<locale> to the locale's customization, else the base's
customization, else the base file. Names with their own file send as
before.
- cabana: mail locales are the translator's plus the TranslationWriter's
enabled locales; sync ensures the locale rows and re-syncs when the
locale set changes; record lookups admit fallback-locale rows; the
record title is the base code; RecordMeta.LocaleVariants
(RecordLocaleVariant) on the show and update responses.
- admin: LocaleVariantSwitcher in the update form header, from
meta.localeVariants, behind the unsaved-changes confirm.
- tests: TestMailOverrideSmoke/locale_fallback,
TestMailScreensSmoke/locales, LocaleVariantSwitcher.test.ts.
- Brand, DefaultBrand and CompileBrandCSS: thirteen colours, each checked
as a six-digit hex colour, compiled into CSS for plain elements and the
built-in layouts and partials
- once the branding row exists its compiled CSS replaces mail.brandCss;
mail.css still follows, and the file version sent after a failing
override keeps the Branding
- layouts get logoUrl, built per send from storage.uploads.public_url or
app.url through attach.AbsolutePublicURL; a logo that cannot be shown is
left out with a rate-limited warning
- Editor previews and validates a Branding draft (rule colour)
Plan 35-01, task 5.
- sample.<path> header keys and a parse-tree walker that fills every other
variable with a visible [path] placeholder, nested fields and range
targets included
- every file entry carries the sha256 of its CRLF-normalized text; the
catalog lists its files (Templates, Layouts, Partials) for admin code
- SyncIndex upserts one index row per file and never touches the override
columns of a customized row; ResetOverride returns a row to its file
- Editor validates, previews and test-sends a template, layout or partial
draft through the render path of Send and reports field and rule
- pact.RowStateCustomized and pact.RowStateOutdated
Plan 35-01, task 4.
- pact.HasMailPartials: plugins declare <plugin>::mail.partials.<name>,
loaded from views/mail/partials/<name>.htm; HasMailTemplates is unchanged
- bodies and layouts call {{ partial "name" "key" value ... }}; a call in a
Markdown body leaves a per-render random token swapped after goldmark, so
raw HTML stays disabled for bodies
- built-in partials button, panel, table and subcopy, built-in layouts
system and minimal next to the unchanged default, reachable by alias
after a plugin's own aliases
- NewDBSource also reads customized and database-only layouts and
customized partials; a layout's CSS goes before mail.css
Plan 35-01, task 3.
- postcard owns the system_mail_* tables (postcard.Migrations), run by lagoon
as the framework set summercms.postcard after system_files
- Send asks an OverrideSource once per message; NewDBSource reads the
customized template row through the *gorm.DB published on the app
- a failed lookup, missing tables or an override that does not render or
fails the safety checks sends the file version and is logged
- the caller's Message.Subject still wins; Mailer, Message, NewMailer,
Catalog.Register and BootPlugin keep their signatures
Plan 35-01, task 2 (tracer).