Notification Emails
The starter includes two categories of notification emails: subscription notifications and sensitive action verification codes.
The starter includes two categories of notification emails: subscription notifications and sensitive action verification codes.
Subscription Emails
File: packages/backend/convex/email/templates/subscriptionEmail.tsx
Two templates are provided:
Subscription Success
Sent when a subscription payment is processed successfully.
- Confirms the PRO subscription is active
- Links to the app
Subscription Error
Sent when a subscription payment fails.
- Notifies the user of the payment issue
- Assures them they were not charged
- Links to the app
Wiring into Webhooks
These templates are not wired to a webhook by default. Send them the same way as
every other email in the starter: render the template, then call the sendEmail
facade from your billing webhook handler (see auth.ts and challenges.ts for
the same pattern in use).
import { sendEmail } from "./email";
import {
renderSubscriptionSuccessEmail,
renderSubscriptionSuccessText,
} from "./email/templates/subscriptionEmail";
// In your billing webhook handler:
const options = {
appName: env.APP_NAME,
email: customerEmail,
subscriptionId: "sub_123",
siteUrl: env.SITE_URL,
};
await sendEmail(ctx, {
to: customerEmail,
subject: "Successfully Subscribed to PRO",
html: await renderSubscriptionSuccessEmail(options),
text: renderSubscriptionSuccessText(options),
});Sensitive Action Verification Email
File: packages/backend/convex/email/templates/sensitiveActionVerificationEmail.tsx
Sent when a user needs to verify their identity for a sensitive action via email code.
The email contains:
- A "Verify it's you" heading
- The specific action being verified (e.g. "Delete this organization")
- A large, styled verification code
- Expiration notice
- Safety message if the user didn't request it
Template Parameters
| Parameter | Description |
|---|---|
code | The one-time verification code |
actionLabel | Human label for the action (e.g. "Delete your account") |
appName | Product name from APP_NAME env var |
expiresInMinutes | Minutes until the code expires |
Next Reads
- Customizing Email Templates — editing templates.
- Security Model — step-up verification system.
Magic Link Emails
The magic link email is sent when a user signs in with the passwordless magic link flow.
UI Overview
Leave Localhost ships a shared UI package at packages/ui that both the product app (apps/app) and the marketing site (apps/marketing) import from. The package is built on shadcn/ui, Radix primitives, Tailwind CSS v4, and class-variance-authority for variant-driven styling.