Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indrivo/gr.notifications.mnotify
Implementation of gov service MNotify
https://github.com/indrivo/gr.notifications.mnotify
Last synced: about 1 month ago
JSON representation
Implementation of gov service MNotify
- Host: GitHub
- URL: https://github.com/indrivo/gr.notifications.mnotify
- Owner: indrivo
- License: mit
- Created: 2021-07-07T12:34:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-07T14:53:59.000Z (over 3 years ago)
- Last Synced: 2023-03-03T00:01:24.416Z (almost 2 years ago)
- Language: C#
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GR.Notifications.MNotify
Implementation of gov service MNotify[![Build Status](https://travis-ci.com/indrivo/GR.Notifications.MNotify.svg?branch=main)](https://travis-ci.com/indrivo/GR.Notifications.MNotify)
[![.NET](https://github.com/indrivo/GR.Notifications.MNotify/actions/workflows/dotnet.yml/badge.svg?branch=main)](https://github.com/indrivo/GR.Notifications.MNotify/actions/workflows/dotnet.yml)
[![NuGet](https://img.shields.io/nuget/v/GR.Notifications.MNotify.svg)](https://www.nuget.org/packages/GR.Notifications.MNotify)
[![Nuget](https://img.shields.io/nuget/dt/GR.Notifications.MNotify)](https://www.nuget.org/packages/GR.Notifications.MNotify)# Usage
1. Install package from [nuget](https://www.nuget.org/packages/GR.Notifications.MNotify/)
```powershell
Install-Package GR.Notifications.MNotify
```2. Register th services:
```C#
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}private IConfiguration Configuration { get; }
//...
public void ConfigureServices(IServiceCollection services)
{
//...
services.AddMNotify(Configuration);
//...
}//...
}
```3. Add configuration on your appsettings.json file:
```json
{
"MNotifyOptions": {
"ServiceClientAddress": "https://testmnotify.gov.md:8443/MNotify.svc",
"ServiceCertificatePath": ".pfx",
"ServiceCertificatePassword": ""
}
}
````ServiceClientAddress` - url of service
`ServiceCertificatePath` - physical path to pfx certificate
`ServiceCertificatePassword` - certificate password4. Inject MNotify Service and send notifications
```C#
public class FooService{
private readonly IMNotifyService _service;public FooService(IMNotifyService _service){
_service = service;
}public async Task FooMethodAsync(){
var sendResult = await mNotifyService.SentNotificationAsync(new MNotifyNotification
{
Sender = new MNotifyPerson("UserName", "[email protected]"),
Recipient = new MNotifyPerson("UserName", "[email protected]"),
NotificationType = "Test",
Subject = "Notification subject",
Content = "Test notification"
});
}
}
```