Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
20 lines
823 B
Markdown
20 lines
823 B
Markdown
# @kit/mailers — Email Service
|
|
|
|
## Non-Negotiables
|
|
|
|
1. ALWAYS use `getMailer()` factory from `@kit/mailers` — never instantiate mailer directly
|
|
2. ALWAYS use `@kit/email-templates` renderers for HTML — never write inline HTML
|
|
3. ALWAYS render template first (`renderXxxEmail()`), then pass `{ html, subject }` to `sendEmail()`
|
|
4. NEVER hardcode sender/recipient addresses — use environment config
|
|
|
|
## Workflow
|
|
|
|
1. Render: `const { html, subject } = await renderXxxEmail(props)`
|
|
2. Get mailer: `const mailer = await getMailer()`
|
|
3. Send: `await mailer.sendEmail({ to, from, subject, html })`
|
|
|
|
## Exemplars
|
|
|
|
- Contact form: `apps/web/app/[locale]/(marketing)/contact/_lib/server/server-actions.ts`
|
|
- Invitation dispatch: `packages/features/team-accounts/src/server/services/account-invitations-dispatcher.service.ts`
|