Static ReadonlyBUILT_The built-in template of every message, in English: its id, category, title, placeholders, links and three parts.
Static ReadonlyCATEGORIESThe message categories (security, account, notification), with
whether a person may decline each.
Static ReadonlyCOMMONThe placeholders every message offers: realm and service.
Static ReadonlyLAYOUT_The id of the layout every message is wrapped in: layout.
StaticbuiltFinds the built-in template with an id.
the message's id
the template, or null
StaticbuiltFinds the built-in translation of a message (or of the layout) for a language: the first file along the language's chain that has it.
the message's id, or layout
a language tag, in any case
{ parts, lang } with lang the catalog tag that answered, or
null for English, a language no catalog answers, or an unknown id
StaticbuiltLists the catalog tags a message has a built-in translation in (an overlay counts when its base has the message).
the message's id, or layout
catalog tags, sorted
StaticcategoryFinds a category by id.
the category's id
the category, or null
StaticchainLists the translation files to read for a language tag, overlay first, English left out; empty when no catalog answers the tag.
a language tag, in any case
catalog tags, most specific first
StatichtmlWraps an HTML part in the one document every message is: a language tag and a head that loads nothing.
the HTML part
the language tag; en when absent
the document
StaticlanguageOrders the languages to try for a message, best first: each tag of an
Accept-Language value and its primary subtag by q, then the realm's
default, then en.
the entry's preferredLanguage
the realm's default language
the language tags
StaticlocaleReads common/mail_locales/*.json once, keyed by catalog tag. An
unreadable file is logged (STS-I18N-0001) and left out.
every translation file, by catalog tag
StaticplaceholdersLists every {{name}} placeholder in a piece of text, once each.
the text
the placeholder names
StaticplainPrepares a value for a subject or a text part: every control character, CR and LF above all, becomes a space.
the value
the text
StaticproblemChecks a realm's template against the rules, when it is saved: all three parts, sizes, placeholders the message offers, no address of its own, every link in the text part, and no HTML that loads or runs anything.
the built-in template it rewords
{ subject, text, html }
one sentence saying what is wrong, or '' when nothing is
StaticreasonSays why a person received a message of a category, in a language: the words the layout finishes "because it is ..." with.
the category's id
the language the layout went out in
the reason
StaticrenderRenders a template: each placeholder filled with its value, escaped for HTML in the HTML part and stripped of control characters elsewhere. A placeholder with no value renders empty.
the template's { subject, text, html }
every placeholder's raw value, links already absolute
{ subject, text, html }
StaticwrapWraps a rendered message in the layout: its body as {{content}},
unescaped since it was escaped when rendered, and its subject as
{{subject}}.
the layout's { subject, text, html }
render()'s answer for the message
the other placeholders' values
{ subject, text, html }
The mail channel's messages: the built-in template of every message this service sends, the rules a realm's own template must keep, and the renderer.
Values are escaped by the renderer, a link is always a placeholder for this service's own address, and the HTML part may load and run nothing. A library that stores nothing.