# @loma-portal/em-notifications

Send notifications via a channel-abstracted interface. Producer enqueues; worker dispatches.

| Channel | Class            | Real today?                                           |
| ------- | ---------------- | ----------------------------------------------------- |
| `email` | `SmtpChannel`    | Yes (nodemailer)                                      |
| `push`  | `FcmChannel`     | Yes (firebase-admin)                                  |
| `sms`   | `NoopSmsChannel` | Stub — `features.sms = null` in `project.config.json` |

## Producer (API host)

```ts
import { EmNotificationsModule, NotificationDispatcher } from '@loma-portal/em-notifications';

@Module({
  imports: [EmNotificationsModule.forRoot({ redisUrl: process.env.REDIS_URL! })],
})
export class AppModule {}

await this.dispatcher.send({
  kind: 'email',
  recipient: { address: 'user@example.com' },
  subject: 'Welcome',
  body: 'Hello',
});
```

## Worker (worker-nest)

The worker imports the concrete channels it wants to enable, picks the right one per `payload.kind`, and processes the BullMQ queue. See `apps/worker-nest/src/processors/notification.processor.ts`.
