Communication Module

Horizontal message delivery service — email, SMS, in-app notifications, templates, delivery audit, and channel configuration for all modules.

The Communication module owns ALL message delivery in SCRIPE. Every module (Identity, Entitlements, Compliance, etc.) dispatches messages through IMessageDispatcher — never directly via SMTP or Twilio. This isolation means channel providers can be swapped, rate limits enforced, and all delivery attempts audited in one place.

Architecture

Identity and other modules call IMessageDispatcher (in Core.Application). The Communication module implements this interface via SendEmailCommandHandler / SendSmsCommandHandler. The handler renders the template (Scriban engine), selects the provider (SMTP in Prod, console log in Dev), persists a SentMessageLog, and tracks delivery attempts for retry.

Message Templates

Templates are versioned, multi-channel records (Email / SMS / InApp / Push / WhatsApp). Each template has a draft → published lifecycle. The Scriban engine renders templates with typed model bindings — no raw string concatenation. System templates (welcome, password-reset, OTP) are seeded at startup and cannot be deleted.

Background Jobs

MessageRetryJob runs every 5 minutes to retry failed deliveries (exponential backoff: 5s → 30s → 5min, max 3 retries). CommunicationSoftDeleteCleanupJob runs nightly at 3 AM to permanently purge soft-deleted records older than 30 days. Both jobs implement IAutoRegisteredJob and are provider-agnostic (Native / Hangfire / Quartz).

Permissions

communication.templates.view/create/update/delete | communication.send.email/sms/notification/bulk | communication.logs.view | communication.preferences.manage | communication.channels.configure | communication.export