| name | emails |
| description | Use this skill when: Create email template, Send notification. Focus on user intent. Trigger keywords: emails. |
Handling Emails
Instructions
Emails
Use this file when tasks involve transactional emails, providers, or templates.
Scope
- Email provider wiring in
src/lib/email
- Environment variable setup for providers
- Sender identity in
src/config/app.ts
- Email template authoring in
src/shared/emails
- Sending flows that call
sendEmail
Rules
- Keep provider exports centralized in
src/lib/email/index.ts.
- Enable only the provider needed for the target environment.
- Keep sender identity in
APP_CONFIG.emails (from, fromName).
- Store templates under
src/shared/emails.
- Reuse existing template styles and helper components in
src/shared/emails/common.
- Use server-side code paths for sending emails.
Quick checklist
- Add required env variables in
src/config/env.ts and .env.
- Export selected provider from
src/lib/email/index.ts.
- Add or update template in
src/shared/emails.
- Call
sendEmail({ to, subject, component }) in the feature flow.
- Preview template with
pnpm email:dev.
Validation & Gotchas
- Ensure all paths use forward slashes
/.
- Check edge cases related to Handling Emails.