Skip to main content

Notification Channel Architecture

Summary

Delivery is abstracted behind IChannelSender. Exactly one sender is registered per channel; the registry resolves a channel name to its sender case-insensitively. In-app messages persist as inbox items; email selects a provider at startup; SMS and WhatsApp are placeholders with no real provider.

Sender resolution

The abstraction

IChannelSender exposes Channel, Provider and SendAsync. The contract is that a sender throws on failure so the dispatcher records a failed attempt and retries; a successful send returns an optional human-readable detail. A SendContext carries the resolved recipient and a ForceFail flag.

Registry

ChannelSenderRegistry builds a case-insensitive dictionary keyed on the normalized channel name; the last registration for a channel wins. TryGet returns false when no sender is registered for a channel, which the dispatcher treats as an immediate failure.

Per-channel implementations

ChannelProvider id(s)Verified behavior
InAppinappNo external I/O; the persisted message is the inbox item
Emailconsole, smtp, noopConsoleEmailSender logs; SmtpEmailSender sends via System.Net.Mail.SmtpClient; NoOpEmailSender records a suppressed success
SMSsms-noopPlaceholder — logs a simulated delivery; no real gateway
WhatsAppwhatsapp-noopPlaceholder — logs a simulated delivery; no real Business API

The email provider is chosen once at startup from Notification:Email:Provider. Every sender honors the ForceFail flag by throwing, which the smoke script uses to exercise the failure/retry path.

Address resolution

The dispatcher maps a channel to a delivery address before sending: in-app uses the recipient external reference, email uses the recipient email, and SMS/WhatsApp use the phone. A channel with no resolvable address is skipped and audited as suppressed.

Verified absence

There is no real SMS or WhatsApp provider integration, no push-notification (PushSender) channel and no per-tenant provider selection. Placeholder senders record simulated deliveries only.

Requires Confirmation

Production email host and credentials, and the intended real SMS/WhatsApp providers, require confirmation.

Source References

  • microservices/src/notification-service/Channels/ChannelSenderRegistry.cs
  • microservices/src/notification-service/Channels/EmailSenders.cs
  • microservices/src/notification-service/Channels/InAppSender.cs
  • microservices/src/notification-service/Channels/PlaceholderSenders.cs

See Also

Keywords

Channels, sender, registry, in-app, email, SMS, WhatsApp, placeholder.

Revision Information

  • Status: Draft
  • Last reviewed: 2026-07-21
  • Next review: 2026-10-21