---
name: email-template
description: Build transactional email templates (i18n, responsive) sent via em-notifications. Use for any outbound email.
---

# Skill: Email Template

## When to use

Welcome, password reset, approval notifications, digests.

## Steps

1. Author an HTML template with inline CSS (email clients strip `<style>`); provide a plaintext fallback.
2. i18n: render per recipient locale (`recipient.locale`), default `th`.
3. Send via `NotificationDispatcher.send({ kind: 'email', ... })` — it queues; `SmtpChannel` delivers in the worker.

## Gotchas

- Inline all CSS (use a tool or write inline) — Gmail/Outlook drop `<head>` styles.
- Always include a plaintext `body` alongside `htmlBody` — spam filters penalize HTML-only.
- Thai text needs a UTF-8 charset meta + a web-safe fallback font.
- Never put secrets/tokens in email bodies except single-use, short-expiry links.
- Test against the SMTP container in docker-compose before wiring a real provider.

## Validation

Renders in Gmail + Outlook; plaintext present; Thai displays; links expire; sent via the queue.
