Skip to main content

Template Declarative Resources

Thunder supports loading templated content (for example: email templates) as declarative resources at startup. Templates are YAML files placed under the configured templates directory and are loaded into the template service used by executors (e.g., EmailExecutor).

Where to place files

  • Templates are loaded from templates under the repository resources directory. When running from a container the path is /app/repository/resources/templates.

YAML schema (minimal example)

id: invite-email
displayName: "User invitation email"
scenario: USER_INVITE
type: email
subject: "You're invited"
contentType: "text/html"
body: |
Hi,
Click here to join: {{ctx(inviteLink)}}

Required fields

  • id — unique template identifier
  • displayName — human-friendly name
  • scenario — scenario type (see supported values below)
  • type — template type (e.g., email)
  • subject — subject used when sending emails
  • contentType — MIME type, e.g. text/plain or text/html
  • body — template body using {{ctx(key)}} syntax for placeholder substitution

Supported scenarios

  • USER_INVITE — used during the user invite flow

Supported context placeholders

  • {{ctx(inviteLink)}} — the invite link for user registration

Notes

  • Templates are validated at load time. Unknown or invalid scenarios will cause initialization to fail.
  • Template rendering uses {{ctx(key)}} placeholders which are substituted with context data at render time.

Examples and usage

Place example YAML files in the configured templates directory and restart server. The executor will fetch templates by scenario and render them with provided template data.

Thunder LogoThunder Logo

Work together seamlessly with secure your applications with ease.

Terms & Policy

Pages

HomeDocsAPIsSDKs
© WSO2 LLC. All rights reserved.