---
name: notification-channel
description: Add a new notification channel (e.g. LINE, Slack, SMS provider) to em-notifications. Use when extending delivery.
---

# Skill: Notification Channel

## When to use

Adding a delivery channel beyond email/push/sms (e.g. LINE Notify, Slack, a real SMS provider).

## Steps

1. Implement `NotificationChannel` in `enterprise-modules/notifications/src/channels/<name>.channel.ts` with `kind` + `send()`.
2. Add the channel kind to the `NotificationKind` union in `types.ts`.
3. Register it in `apps/worker-nest/src/processors/notification.processor.ts#buildChannels()` gated on its env vars.
4. Add env vars to the worker's `env.schema.ts` + `.env.example`.

## Gotchas

- One channel per `kind`; the processor routes by `payload.kind`.
- Fail soft on a single recipient; don't fail the whole batch.
- Respect provider rate limits — the BullMQ worker concurrency is the throttle.
- Replace `NoopSmsChannel` rather than adding a parallel SMS channel.
- Secrets come from env, never hardcoded.

## Validation

New channel sends a real message; env-gated; rate-limit respected; failure isolated to one recipient.
