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
templatesunder 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 identifierdisplayName— human-friendly namescenario— scenario type (see supported values below)type— template type (e.g.,email)subject— subject used when sending emailscontentType— MIME type, e.g.text/plainortext/htmlbody— 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.