5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters 1.0.0-alpha

This is a prerelease version of 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters.
There is a newer version of this package available.
See the version list below for details.
dotnet add package 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters --version 1.0.0-alpha                
NuGet\Install-Package 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters -Version 1.0.0-alpha                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters" Version="1.0.0-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters --version 1.0.0-alpha                
#r "nuget: 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters, 1.0.0-alpha"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters as a Cake Addin
#addin nuget:?package=5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters&version=1.0.0-alpha&prerelease

// Install 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters as a Cake Tool
#tool nuget:?package=5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters&version=1.0.0-alpha&prerelease                

5M Innov Webhook Notification

Description

5M Innov Webhook Notification Microsoft Teams Adapter permet d'envoyer des notification sur un canal Microsoft Teams par l'interm�diaire d'un webhook. Pour cela il est n�cessaire d'utiliser le nuget 5MInnov.Tools.WebhookNotification.Domain.

Fonctionnalit�s principales

  • Envoi de notifications sur un webhook Microsoft Teams.
  • Avertissement en temps r�el des probl�mes critiques.

Pr�requis

  • .NET 8.0 ou version ult�rieure

Installation

Vous pouvez installer ce package via NuGet Package Manager Console :

Install-Package 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters

ou via le .NET CLI :

dotnet add package 5MInnov.Tools.WebhookNotification.MicrosoftTeams.Adapters

Exemple d'utilisation

Voici un exemple basique pour envoyer une 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");
}

Exemple de configuration Webhook

Au pr�alable il faut configurer la partie Webhook Setting dans un fichier appsettings.json :

{
    "WebhookNotificationSettings": {
        "WebhookUrl": "https://webhoook.url",
        "InformationLinkUrl": "https://google.com",
        "Title": "Test App Console"
    }
}

Contributeurs

Licence

Ce projet est sous licence 5M Innov.

Autres informations pertinentes

Pour toute question ou suggestion, veuillez contacter mtrezieres@5minnov.fr.

Liens Utiles

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 102 6/18/2024
1.0.2 77 6/18/2024
1.0.1 79 6/18/2024
1.0.0 74 6/14/2024
1.0.0-alpha 64 6/14/2024

Creation