Omnichannel Communication & Dispatch
Multi-channel SMS, Email, WhatsApp, and Push dispatching with intelligent failover, bilingual Liquid templates, and delivery receipts.
The Communication module acts as SCRIPE's centralized messaging gateway, orchestrating transactional and operational notifications across SMS, Email, WhatsApp, and Realtime Push. Featuring intelligent provider failover, bilingual template interpolation (English and Arabic), and delivery audit logs, it guarantees critical operational messages reach athletes, parents, and staff.
Communication Architecture
Designed to handle high-volume notification spikes during major tournament registrations and schedule changes.
Multi-Provider Gateways
Pluggable provider adapters for Twilio, SendGrid, Unifonic, AWS SES, and custom SMTP/SMPP endpoints.
Transactional Email
HTML/text email delivery with delivery tracking, bounce management, and DKIM/SPF compliance.
High-Throughput SMS
Global and local SMS dispatching with country-code normalization and GSM-7 character optimization.
Bilingual Scriban Templates
Dynamic variable interpolation with built-in preview tools, supporting LTR English and RTL Arabic layouts.
Automated Provider Failover
Seamless fallback to secondary channels upon HTTP 5xx errors or network timeout thresholds.
Immutable Delivery Receipts
Audited delivery attempt logs with provider message IDs, timestamps, and error codes for dispute resolution.
Domain Aggregate Root: ChannelConfiguration
The ChannelConfiguration aggregate manages provider credentials, rate limiting rules, priority routing, and delivery telemetry.
public sealed class ChannelConfiguration : TenantAggregateRoot
{
public CommunicationChannelType ChannelType { get; private set; } // Email, Sms, WhatsApp, Push
public string ProviderName { get; private set; } = string.Empty; // SendGrid, Twilio, Unifonic, Smtp
public string ConfigurationJson { get; private set; } = "{}";
public bool IsPrimary { get; private set; }
public bool IsActive { get; private set; }
public int RateLimitPerMinute { get; private set; } = 100;
public List<DeliveryAttempt> RecentDeliveryAttempts { get; private set; } = new();
public void RecordDeliveryAttempt(string messageId, bool success, string? errorMessage)
{
RecentDeliveryAttempts.Add(new DeliveryAttempt(Id, messageId, success, errorMessage, DateTimeOffset.UtcNow));
RaiseDomainEvent(new DeliveryAttemptRecordedDomainEvent(Id, TenantId, messageId, success));
}
}Failover Dispatching & Delivery Pipeline
The step-by-step lifecycle of an outbound transactional notification from event trigger to confirmed receipt:
Primary API Endpoints
Key endpoints exposed by CommunicationControllers for channel setup, template authoring, and message dispatching.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/v1/communication/channels | List configured communication channels and operational status | 🔒 Required |
| POST | /api/v1/communication/channels | Configure a new SMS, Email, or WhatsApp provider adapter | 🔒 Required |
| GET | /api/v1/communication/templates | Retrieve bilingual message templates with variable schemas | 🔒 Required |
| POST | /api/v1/communication/templates/render-preview | Render a live template preview with mock parameter variables | 🔒 Required |
| POST | /api/v1/communication/messages/send-sms | Dispatch an urgent SMS notification to one or more phone numbers | 🔒 Required |
| GET | /api/v1/communication/logs/sms | Query immutable delivery logs and provider delivery statuses | 🔒 Required |