DC.NotificationService
1.1.0
See the version list below for details.
dotnet add package DC.NotificationService --version 1.1.0
NuGet\Install-Package DC.NotificationService -Version 1.1.0
<PackageReference Include="DC.NotificationService" Version="1.1.0" />
paket add DC.NotificationService --version 1.1.0
#r "nuget: DC.NotificationService, 1.1.0"
// Install DC.NotificationService as a Cake Addin
#addin nuget:?package=DC.NotificationService&version=1.1.0
// Install DC.NotificationService as a Cake Tool
#tool nuget:?package=DC.NotificationService&version=1.1.0
DC Notification Service
About The Project
The DC Notification Service is a .NET 7 based library designed to simplify the process of sending various types of notifications such as emails, SMS, and push notifications. It abstracts the complexity of dealing with different notification providers and offers a unified interface to send notifications with just a few lines of code.
Features
- Extensible Notification Providers: Easily integrate with any email, SMS, or push notification service provider.
- Runtime Provider Selection: Choose which notification service to use at runtime, offering flexibility for different environments and scenarios.
- Support for Multiple Notification Types: Emails with support for HTML content, multiple recipients, CC, and BCC; SMS notifications; Push notifications.
Getting Started
To get started with the DC Notification Service, install the package via NuGet, configure your service provider, and you're ready to send notifications.
Installation
Install the package with NuGet:
dotnet add package DC.NotificationService
Configuration
Configure the services in your Startup.cs
:
public void ConfigureServices(IServiceCollection services)
{
// Configure your notification services here
services.AddEmailService(settings:new EmailSettings()
{
EnableSsl = true,
Host = "smtp-host",
Port = 2525,
Password = "mail-password",
Username = "mail-username",
From = "test@mail.com"
});
}
Usage
Inject the INotificationServiceFactory
to create and send notifications:
public class NotificationController : ControllerBase
{
private readonly INotificationServiceFactory _notificationFactory;
public NotificationController(INotificationServiceFactory notificationFactory)
{
_notificationFactory = notificationFactory;
}
public async Task<IActionResult> SendNotification()
{
EmailMessage emailMessage = new EmailMessage
{
To = new List<string> { "test@mail.com" },
Subject = "Welcome to DC Notification Service",
Content = "<p>This is a test email.</p>",
IsHtml = true
};
await _notificationFactory.SendEmail(emailMessage);
return Ok("Notification sent successfully.");
}
}
Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Don't forget to give the project a star 😃 Thanks again!
To-Do
- Integrate Twilio for SMS notifications.
- Integrate MailChimp for email services.
- Integrate Firebase for push notifications.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- FirebaseAdmin (>= 2.4.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.