class MailFormatter
The formatter email views are given.
Renders through the real formatter, then puts back the values {\Flarum\Mail\MailTranslator} held out of the way, escaped. Content that never went through the mail translator — a post's body via `formatContent()`, for instance — is unaffected, since it carries no markers. Not a subclass: email views only ever call `convert()`, and wrapping avoids inheriting the parser and renderer state the real formatter manages.
Methods
Turn a slot of the plain-text layout into text: tags removed, entities decoded. Slots arrive as rendered Blade, so whatever a view printed with `{{ }}` is escaped already, and plain text has nothing to escape.
Turn plain text an email view was handed into HTML: escaped, with its line breaks kept and its URLs made clickable.
Anything else an email view might reach for goes to the real formatter.
Details
at
line 32
string
convert(string|null $content)
at
line 42
string
htmlToPlain(string|null $content)
Turn a slot of the plain-text layout into text: tags removed, entities decoded. Slots arrive as rendered Blade, so whatever a view printed with `{{ }}` is escaped already, and plain text has nothing to escape.
at
line 61
string
plainToHtml(string|null $content)
Turn plain text an email view was handed into HTML: escaped, with its line breaks kept and its URLs made clickable.
Informational emails (account activation, email confirmation, password reset) do not build their body in a view. It arrives already translated, so its parameters, a display name among them, are part of the string by the time a template sees it, and no markers are left for {\Flarum\Mail\SafeSubstitution} to put back. Rendering such a body with `convert()` would therefore put those values in front of the parser, which is the thing the mail translator exists to prevent. The content is escaped instead, and only URLs are linked: the visible text of every link produced here is the address it points at.
at
line 122
mixed
__call(string $method, array $arguments)
Anything else an email view might reach for goes to the real formatter.