Email templates
Open Authentication → Email templates (or PATCH /v1/projects/{ref}/config/auth with email_templates) to customize the subject, HTML and text of each auth email:
invite, magic_link, recovery, verify_email, otp, tenant_invite.
Missing kinds or fields keep the built-in template.
Variables
Section titled “Variables”Variables use Go-template syntax:
| Variable | Value |
|---|---|
{{ .ConfirmationURL }} |
the link of the email (invite, magic link, recovery, verify, tenant invite) |
{{ .Token }} |
the OTP code (otp), or the token carried by the link |
{{ .Email }} |
recipient |
{{ .SiteURL }} |
the project’s site URL |
{{ .RedirectTo }} |
the validated redirect target (invite, magic link, tenant invite) |
{{ .Data.<key> }} |
the user’s user_metadata.<key> (for example data passed to an invite) |
{{ .TenantName }}, {{ .Role }} |
tenant invitations |
Only plain substitution exists: no if, range, pipelines or helpers, so a template can never run code. In the HTML body every value is HTML-escaped (URLs included); text bodies get raw values; line breaks are removed from the subject. Unknown variables render empty.
Content slot and branded layout
Section titled “Content slot and branded layout”The html of a template is the content fragment only: heading, text and buttons, without <html> or <body>. PotaLab Base places it inside a standard email-safe layout (table based, inline CSS, max 600 px wide, mobile friendly, light and dark aware):
- a header with your project name;
- your content;
- a footer with “If you didn’t request this, you can ignore this email.”, “Sent by (your project name) - Powered by PotaLab Base” and a link to your site.
The footer branding is always added and cannot be removed by a template. The subject is used as hidden preheader text. The class base-btn styles a primary button.
<h1>Welcome back</h1><p>Use the link below to sign in to {{ .SiteURL }}.</p><p><a class="base-btn" href="{{ .ConfirmationURL }}">Sign in</a></p>When you customize the HTML but not the text body, the text part is derived from the rendered HTML. The dashboard preview renders your template with sample values inside the full layout.