Skip to content
Corex

SiteEmailDesign

Corex\Email\Design\SiteEmailDesign · class · Add-ons layer

The design this site’s emails are drawn in: its own, when it gives one that works, and CoreX’s standard one otherwise (spec 106, FR-014 and FR-017). A site gives its design through the filter corex_email_design, from its own plugin: add_filter(‘corex_email_design’, fn () => new AcmeEmailDesign()); A filter and not a container binding, because it is asked when an email is drawn and so does not depend on which plugin booted first. The filter is handed CoreX’s standard design: a design that wants to build on it wraps that one, not the container’s. A site’s design is code CoreX did not write, running at the moment a customer is being answered. Everything of the site’s is inside the guard: the filter’s own callback, the drawing, and anything the design prints instead of returning. If any of it throws, answers nothing, or answers a document without the message, the email goes in the standard design and the failure is announced. An email is never sent without its words, and a broken template never stops a reply.

__construct(StandardEmailDesign $standard, EventDispatcher $events)

Section titled “__construct(StandardEmailDesign $standard, EventDispatcher $events)”

render(EmailContent $content, EmailBrand $brand): string

Section titled “render(EmailContent $content, EmailBrand $brand): string”