FeaturesEmails
PreviousNext

Email Templates

Render typed React email templates from @kit/email-templates.

What It Does

@kit/email-templates provides reusable templates and renderer functions for auth and transactional messages.

When To Use

  • Sending branded emails with shared layout/header/footer.

Prerequisites

  • appConfig available for branding fields when needed.

How To Use

Render template

import { renderWelcomeEmail } from '@kit/email-templates';
 
const { html, subject } = await renderWelcomeEmail({
  appConfig,
  name: 'Jane Doe',
});

Supabase templates

As said in the supabase documentation, supabase use the following templates for authentication.

TemplateDescription
Confirm signupEmail sent to the user to confirm their signup.
Invite userEmail sent to the user to invite them to the project.
Magic LinkEmail sent to the user to sign in to the project.
Change Email AddressEmail sent to the user to confirm their email change.
Reset PasswordEmail sent to the user to reset their password.

Email structure

All email templates follow a common structure:

  • Header component at the top of each email, containing the application logo and branding
  • Footer component at the bottom of each email, containing legal information and unsubscribe links

This consistent structure ensures a professional appearance across all your email communications.

Tailwind configuration

Located in the kit/email/email-templates/tailwind.email.config.ts file.

TailwindConfig

PropTypeDefault
important
Partial<ImportantConfig>
prefix
string
separator
string
safelist
SafelistConfig[]
blocklist
string[]
presets
Partial<Config>[]
future
Partial<FutureConfig>
experimental
Partial<ExperimentalConfig>
darkMode
Partial<DarkModeConfig>
theme
Partial<CustomThemeConfig & { extend: Partial<CustomThemeConfig>...
corePlugins
Partial<CorePluginsConfig>
plugins
(PluginCreator | { handler: PluginCreator; config?: Partial<Config>; } | { (options: any)...

Font configuration

Located in the kit/email/email-templates/tailwind.email.config.ts file.

The config font object allows you to load fonts to use in your emails.

FontConfig

PropTypeDefault
fontFamily*
string
fallbackFontFamily*
FallbackFont |...
webFont
{ url: string; format:...
fontStyle
Property.FontStyle
fontWeight
Property.FontWeight

Email templates

Welcome Email

Used to welcome new users to your application. Use renderWelcomeEmail to render this template.

WelcomeEmailProps

PropTypeDefault
appConfig*
{ description: string;...
name*
string

Confirm Email Address

Used to verify a user's email address during registration. Use renderConfirmEmailAddressEmail to render this template.

ConfirmEmailAddressEmailProps

PropTypeDefault
appConfig*
{ description: string;...
name*
string
verificationLink*
string

Invite User

Used to invite users to join an organization. Use renderInviteUserEmail to render this template.

InviteUserEmailProps

PropTypeDefault
appConfig*
{ description: string;...
name*
string
inviteLink*
string

Password Reset Email

Used to send password reset links to users. Use renderResetPasswordEmail to render this template.

ResetPasswordEmailProps

PropTypeDefault
appConfig*
{ description: string;...
resetPasswordLink*
string

Confirm Changed Email Address

Used to confirm when a user wants to change their email address. Use renderConfirmChangeEmailAddressEmail to render this template.

ConfirmChangeEmailAddressEmailProps

PropTypeDefault
appConfig*
{ description: string;...
confirmLink*
string
newEmail*
string

Revoked Invitation Email

Used to notify users when their invitation to an organization has been revoked. Use renderRevokedInvitationEmail to render this template.

RevokedInvitationEmailProps

PropTypeDefault
appConfig*
{ description: string;...
organizationName*
string

User Delete Email

Used to confirm user account deletion requests. Use renderUserDeleteEmail to render this template.

UserDeleteEmailProps

PropTypeDefault
appConfig*
{ description: string;...

MCP Context

capability: email_template_rendering
entrypoints:
  - kit/email/email-templates/src/index.ts
  - kit/email/email-templates/src/templates/*
inputs:
  - template_name
  - template_props
outputs:
  - html_and_subject
constraints:
  - props must satisfy template-specific types
side_effects:
  - none (render only)

Agent Recipe

  1. Pick template function from package index.
  2. Build typed props payload.
  3. Pass rendered html/subject to active email provider.

Troubleshooting

  • Type errors indicate incorrect template props.
  • Missing branding usually means incomplete appConfig.email.template data.

How is this guide?

Last updated on 3/23/2026