Skip to content
Corex

Layout

Corex\Email\Template\Layout · class · Add-ons layer

Wraps a rendered body in a shared, on-brand HTML email shell. The brand name, accent color, logo, and text direction are runtime values (from brand.json), so a rebrand is configuration (Principle V). Email clients do not support CSS custom properties, so the shell uses inline styles; the only literals are functional email-layout structure (the de-facto 600px body width and spacing), never design tokens — the brand values are injected, not hardcoded. The brand is what the site is when an email is drawn. Given as a closure it is asked then, and not when this object is made: the container makes it for whatever needs the mail stack, which can be while WordPress is still loading plugins, before it knows which way the site’s text runs and before a string may be translated.

wrap(string $subject, string $bodyHtml, array $regions): string

Section titled “wrap(string $subject, string $bodyHtml, array $regions): string”