Skip to content

Document mail template placeholders in White labeling - #640

Merged
vvlladd28 merged 1 commit into
thingsboard:mainfrom
hophead12:docs/mail-template-placeholders
Sep 1, 2026
Merged

Document mail template placeholders in White labeling#640
vvlladd28 merged 1 commit into
thingsboard:mainfrom
hophead12:docs/mail-template-placeholders

Conversation

@hophead12

Copy link
Copy Markdown

Description

The White labeling > Mail templates page listed the available templates but said
nothing about the placeholders you can use inside them, so there was no way to
tell from the docs which variables a given template accepts.

This adds:

  • an Available placeholders column to the template table, listing the
    placeholders each template provides;
  • a Placeholders section describing what every placeholder resolves to;
  • the Test email message template, which was missing from the table.

The template rows are also renamed to match the labels shown in the
Mail template drop-down verbatim (Account activation message instead of
Activation, and so on), so the table can be read side by side with the UI.

Two behaviours are called out explicitly because they are easy to get wrong and
both break silently:

  • Placeholders are substituted only in the mail body. The subject is sent as
    plain text, so ${...} in a subject reaches the recipient literally.
  • A placeholder the template does not provide breaks that template entirely.
    Rendering fails, so no email of that type is sent at all — for any user, and
    permanently, until the placeholder is removed. There is no fallback to the
    default template, and the placeholder is not left in the text as-is. A typo in
    a placeholder name has exactly the same effect.

Everything was verified against the platform sources: the FreeMarker model built
per template in DefaultMailService, the shipped defaults in
mail_templates.json (whose bodies use exactly those variables and no others),
and the UI labels in locale.constant-en_US.json.

The three Api usage state templates are intentionally left out: the
GET /api/whiteLabel/mailTemplates endpoint strips them from its response for
every authority, so they never appear in the drop-down and cannot be configured
here.

Type of change

  • Shared include file (src/content/_includes/**)

Affected products

PE, PaaS and PaaS/EU — the page is a PE feature, and all four product stubs
(CE, PE, PaaS, PaaS/EU) share the single include that changed, so the new
content appears on all of them.

Related issues

None.

Checklist

  • pnpm check passes (Astro / TypeScript) — 0 errors, 0 warnings, 0 hints
  • pnpm lint:eslint passes
  • pnpm lint:slugcheck passes
  • pnpm lint:linkcheck — not run. No pages were added, renamed or removed
    and no links were touched (the one DocLink on the page is unchanged), so
    there is nothing new for it to resolve. Happy to run it if you'd like.
  • Renamed/removed pages have a redirect — n/a, no pages renamed or removed
  • No hardcoded versions
  • Screenshots attached for visual changes — n/a, no new images; the two
    existing screenshots are unchanged

Add the available placeholders for each mail template and a section
describing what each one resolves to. Rename the template rows to match
the labels shown in the White labeling > Mail templates drop-down and
add the missing Test email message template.

Placeholders are only substituted in the mail body — the subject is sent
as plain text. Warn that a placeholder the selected template does not
provide breaks that template entirely: rendering fails, so no email of
that type is sent at all until the placeholder is removed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ThingsBoard documentation for White labeling → Mail templates to clearly document which FreeMarker placeholders are supported by each template, helping admins avoid silent template rendering failures when customizing email bodies.

Changes:

  • Expanded the mail template table with an Available placeholders column and aligned template names with the UI labels.
  • Added a new Placeholders section explaining substitution behavior (body-only) and documenting each placeholder’s meaning.
  • Added the missing Test email message template entry.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@vvlladd28
vvlladd28 merged commit 8a7ca3c into thingsboard:main Sep 1, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants