Skip to content

Notifications Module Overview

The Notifications module is responsible for sending out communications to users, clients, and internal administrators. It currently supports template-based emails and direct SMS delivery through Twilio. It operates primarily as a reactive module that listens to in-process CQRS integration events from other domains such as identity and dispatches the corresponding notifications.

Architecture

This module follows a CQRS-based architecture:

  • Presentation: Event consumers react to integration events like UserRegistered, NewDeviceLogin, and PasswordChanged, and the module also exposes a dev-only SMS test controller.
  • Application: Command handlers (for example SendEmailNotificationHandler and SendSmsNotificationHandler) orchestrate message preparation, provider delivery, and notification logging.
  • Infrastructure: Adapters for Nodemailer, Twilio, and the email TemplateRegistry handle the actual external communication.
  • Domain: Tracks the state and history of notifications sent via the NotificationLog entity.

Sub-Domains