Authula uses Go's html/template and text/template engines for all email rendering. Templates are embedded at build time via go:embed, with optional runtime overrides via environment variables.
Every email type (verify email, password reset, magic link sign-in, etc.) has three template files under its plugin's templates/ directory:
File
Engine
Purpose
subject.tmpl
text/template
Email subject line
text.tmpl
text/template
Plain-text body
html.tmpl
html/template
HTML body (auto-escaped, missingkey=error)
Templates are parsed eagerly during plugin Init(). If parsing fails, the plugin fails to start (fail-fast). Environment variable overrides are read once at startup and are immutable for the process lifetime.
# .envAUTHULA_TEMPLATE_VERIFY_EMAIL_HTML="<div> <h1>Hi {{.UserEmail}},</h1> <p>Click <a href='{{.VerificationLink}}'>here</a> to verify your email.</p> <p>This link expires in {{humanDuration .Expiry}}.</p></div>"
Templates use Go's standard template syntax ({{.FieldName}}). The HTML templates automatically escape HTML characters (e.g., < becomes <), so you never need to manually escape values in the HTML body.
<div> <p>Hello {{.UserEmail}},</p> <p> Please verify your email address by clicking the following link: <a href="{{.VerificationLink}}">Verify your email</a> </p> <p>This link will expire in {{humanDuration .Expiry}}.</p> <p>If you did not request this, please ignore this email.</p></div>