5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters
1.0.2
See the version list below for details.
dotnet add package 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters --version 1.0.2
NuGet\Install-Package 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters -Version 1.0.2
<PackageReference Include="5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters" Version="1.0.2" />
paket add 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters --version 1.0.2
#r "nuget: 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters, 1.0.2"
// Install 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters as a Cake Addin #addin nuget:?package=5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters&version=1.0.2 // Install 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters as a Cake Tool #tool nuget:?package=5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters&version=1.0.2
5M Innov Webhook Notification Microsoft Teams Adapter
Description
The 5M Innov Webhook Notification Microsoft Teams Adapter allows sending notifications to a Microsoft Teams channel via a webhook. To do this, it is necessary to use the nuget 5MInnov.Tools.WebhookNotification.Domain.
Main Features
- Sending notifications to a Microsoft Teams webhook.
- Real-time warning of critical issues.
Prerequisites
- .NET 8.0 or later
Installation
You can install this package via the NuGet Package Manager Console:
Install-Package 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters
or via the .NET CLI:
dotnet add package 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters
Example of Use
Here is a basic example to send a notification:
using _5MInnov.Tools.WebhookNotification.Domain;
using _5MInnov.Tools.WebhookNotification.Domain.Models;
using _5MInnov.Tools.WebhookNotification.Domain.Ports;
using _5MInnov.Tools.WebhookNotification.Enums;
using _5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters;
using _5MInnov.Tools.WebhookNotification.Ports;
using _5MInnov.Tools.WebhookNotification.Ports.Models;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
IConfiguration Configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();
WebhookNotificationSettings webhookNotificationSettings = new WebhookNotificationSettings();
Configuration.Bind("WebhookNotificationSettings", webhookNotificationSettings);
var serviceProvider = new ServiceCollection()
.AddSingleton<IWebhookNotificationSettings, WebhookNotificationSettings>(f => webhookNotificationSettings)
.AddSingleton<IWebhookNotification, MsTeamsWebhookNotification>()
.AddLogging()
.AddSingleton<IWebhookNotificationService, WebhookNotificationService>()
.BuildServiceProvider();
IWebhookNotificationService? webhookNotificationService = serviceProvider.GetService<IWebhookNotificationService>();
if (webhookNotificationService != null)
{
bool result = await webhookNotificationService.PostNotificationAsync(NotificationType.Error, "Test error message", description: "Description d�taill�e de l'erreur");
}
Webhook Configuration Example
First, you need to configure the Webhook Setting part in an appsettings.json file:
{
"WebhookNotificationSettings": {
"WebhookUrl": "https://webhoook.url",
"InformationLinkUrl": "https://google.com",
"Title": "Test App Console",
"RaiseError" : "false"
}
}
Contributors
License
This project is licensed under 5M Innov.
Other Relevant Information
For any questions or suggestions, please contact mtrezieres@5minnov.fr.
Useful Links
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
-
net8.0
- 5MInnov.Tools.WebhookNotification.Ports (>= 1.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.4 | 126 | 6/18/2024 |
1.0.2 | 95 | 6/18/2024 |
1.0.1 | 95 | 6/18/2024 |
1.0.0 | 93 | 6/14/2024 |
1.0.0-alpha | 78 | 6/14/2024 |
Fix readme