SupportMessage
Corex\Guides\Support\SupportMessage · class · Add-ons layer
One support message, and the context that makes it answerable (spec 093). Introduced because the message now has two renderings — a branded HTML template when Corex Mail is bound, and plain text for the wp_mail() floor — and the parts must not be assembled twice. When the controller composed the body itself, the HTML path could only have been a second copy of the same fields, free to drift from the first. Everything here is already sanitized by {@see SupportRequestController}. This object formats; it does not clean. It holds no word of the email. What the message is about is a key, and every label and every stand-in (“a signed-in user”) is translated when a rendering is asked for. {@see SupportMailer} asks in the email’s language; the request that posted the form is in the sender’s own (DECISIONS #362).
Public API
Section titled “Public API”__construct(string $category, string $message, string $replyTo, string $senderName, string $siteName, string $siteUrl)
Section titled “__construct(string $category, string $message, string $replyTo, string $senderName, string $siteName, string $siteUrl)”subject(): string
Section titled “subject(): string”categoryLabel(): string
Section titled “categoryLabel(): string”What the message is about, in words.
body(): string
Section titled “body(): string”The message, truncated once so neither rendering has to remember to.
sender(): string
Section titled “sender(): string”replyAddress(): string
Section titled “replyAddress(): string”plainText(): string
Section titled “plainText(): string”The plain-text rendering, for the wp_mail() floor. Kept because that rung sends without a Content-Type header, so the recipient’s client treats it as text/plain and these newlines are real. The Corex Mail rung is the opposite — its driver stamps text/html on everything — which is why sending this string there produced one run-on paragraph until spec 093.
context(): array
Section titled “context(): array”The merge context for {@see SupportRequestTemplate}. Nested under support because MailContext walks dotted paths, and a flat message key would sit in the same namespace as the submission.* and user.* variables Email Studio defines.