A modern, extensible messaging framework for .NET that provides a unified abstraction layer for various messaging providers including SMS, email, WhatsApp, and push notifications. The framework offers strong type safety, comprehensive validation, and flexible connector architecture.
Modern applications often need to send notifications through multiple channels (SMS, email, WhatsApp, push notifications, webhooks). Each provider has different APIs, authentication methods, and message formats. The Deveel Messaging Framework solves this by:
- Unified API: Single interface for all messaging providers
- Type Safety: Strongly-typed endpoints and configurations prevent runtime errors
- Extensibility: Easy to add new connectors and message types
- Validation: Built-in message and configuration validation
- Webhook Support: Comprehensive webhook handling for message receiving and status updates
- Testability: Comprehensive mocking and testing support
- Performance: Async/await throughout with efficient resource usage
Package | Description | NuGet |
---|---|---|
Deveel.Messaging.Abstractions |
Core messaging abstractions and models | |
Deveel.Messaging.Connector.Abstractions |
Base classes and interfaces for connectors |
Connector | Provider | Type | Documentation | Package | Nuget |
---|---|---|---|---|---|
Twilio SMS | Twilio | SMS | π Guide | Deveel.Messaging.Connector.Twilio |
|
Twilio WhatsApp | Twilio | π Guide | Deveel.Messaging.Connector.Twilio |
||
Firebase FCM | Firebase | Push | π Guide | Deveel.Messaging.Connector.Firebase |
|
SendGrid Email | SendGrid | π Guide | Deveel.Messaging.Connector.Sendgrid |
π Complete Connector Documentation - Detailed installation, configuration, and usage guides for all connectors.
# Install core messaging abstractions
dotnet add package Deveel.Messaging.Abstractions
# For building custom connectors
dotnet add package Deveel.Messaging.Connector.Abstractions
Each connector has specific installation and setup instructions in its documentation:
- π± SMS: Twilio SMS Installation Guide
- π¬ WhatsApp: Twilio WhatsApp Installation Guide
- π Push: Firebase FCM Installation Guide
- π§ Email: SendGrid Email Installation Guide
Pick the connector that matches your needs from the connector documentation.
All connectors follow the same pattern:
using Deveel.Messaging;
// 1. Define a schema
var schema = new ChannelSchema("Provider", "Type", "1.0.0")
.WithCapabilities(ChannelCapability.SendMessages)
.AllowsMessageEndpoint(EndpointType.EmailAddress)
.AddContentType(MessageContentType.PlainText);
// 2. Create and configure connector
var connector = new ProviderConnector(schema);
await connector.InitializeAsync(cancellationToken);
// 3. Build and send message
var message = new MessageBuilder()
.WithId("msg-001")
.WithEmailSender("[email protected]")
.WithEmailReceiver("[email protected]")
.WithTextContent("Hello from our service!")
.Message;
var result = await connector.SendMessageAsync(message, cancellationToken);
if (result.IsSuccess)
{
Console.WriteLine($"Message sent: {result.Value?.MessageId}");
}
Each connector has detailed examples in its documentation:
- π± Twilio SMS Examples
- π¬ WhatsApp Business Examples
- π Firebase Push Examples
- π§ SendGrid Email Examples
// Type-safe endpoint creation
var emailEndpoint = Endpoint.EmailAddress("[email protected]");
var phoneEndpoint = Endpoint.PhoneNumber("+1234567890");
var deviceEndpoint = Endpoint.DeviceId("firebase-device-token");
// Rich content support
.WithHtmlContent("<h1>Welcome!</h1>")
.WithTemplateContent("template-name", new { user = "John" })
.WithMediaContent("https://example.com/image.jpg", "image/jpeg")
// Bidirectional messaging
[HttpPost("webhook/provider")]
public async Task<IActionResult> ReceiveMessage([FromForm] Dictionary<string, string> data)
{
var messageSource = MessageSource.FromFormData(data);
var result = await connector.ReceiveMessagesAsync(messageSource, cancellationToken);
return Ok();
}
var result = await connector.SendMessageAsync(message, cancellationToken);
if (!result.IsSuccess)
{
Console.WriteLine($"Error: {result.ErrorMessage}");
// Handle specific error cases
}
- π Getting Started Guide - Step-by-step setup and first message
- π Connector Documentation - Complete connector guides
- ποΈ Channel Schema Guide - Schema configuration
- β‘ Connector Implementation - Building custom connectors
- π― Endpoint Types - Type-safe endpoint usage
- π Advanced Configuration - Production patterns
- π± Twilio SMS - SMS messaging with webhooks
- π¬ Twilio WhatsApp - WhatsApp Business integration
- π Firebase FCM - Push notifications
- π§ SendGrid Email - Email delivery
- π₯ Firebase Cloud Messaging - Complete FCM connector with multicast support
- π¬ Enhanced WhatsApp Business - Interactive elements, templates, and media
- π Two-Way SMS - Webhook support for incoming messages and status updates
- π Batch Processing - Efficient bulk operations across all connectors
- π‘οΈ Health Monitoring - Built-in connection testing and diagnostics
The framework includes comprehensive test suites with over 500 tests:
# Run all tests
dotnet test
# Run tests for specific areas
dotnet test test/Deveel.Messaging.Abstractions.XUnit
dotnet test test/Deveel.Messaging.Connector.Twilio.XUnit
We welcome contributions! Please see our Contributing Guide for details.
# Clone and build
git clone https://github.com/deveel/deveel.messaging.git
cd deveel.messaging
dotnet build
dotnet test
This project is licensed under the MIT License - see the LICENSE file for details.
- π Documentation: docs/README.md
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π§ Email: [email protected]
Built with β€οΈ by the Deveel team