WebhookSenderHub 1.0.2

dotnet add package WebhookSenderHub --version 1.0.2                
NuGet\Install-Package WebhookSenderHub -Version 1.0.2                
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="WebhookSenderHub" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WebhookSenderHub --version 1.0.2                
#r "nuget: WebhookSenderHub, 1.0.2"                
#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 WebhookSenderHub as a Cake Addin
#addin nuget:?package=WebhookSenderHub&version=1.0.2

// Install WebhookSenderHub as a Cake Tool
#tool nuget:?package=WebhookSenderHub&version=1.0.2                

WebhookSenderHub

WebhookSenderHub is a .NET library that allows you to send webhook messages to various real-time messaging platforms such as Teams, Slack, and Discord using webhooks.

Compatibility

This library is compatible with .NET Standard 2.0.

Installation

You can install the WebhookSenderHub NuGet package using the following command in the NuGet Package Manager Console:

Install-Package WebhookSenderHub

Usage

Microsoft Teams

To send messages to Microsoft Teams using the TeamsService, follow these steps:

  1. Install the WebhookSenderHub NuGet package.
  2. Create an instance of the TeamsService class with the webhook URL and optional channel name.
  3. Use the various SendAsync methods to send messages to Teams.

Here's an example of sending a message to Teams:

using WebhookSenderHub;

IMessagingService messagingService = new TeamsService("your_teams_webhook_url", "optional_channel_name");

bool success = await messagingService.SendAsync("Hello from WebhookSenderHub!", "Webhook Message", "This is a sample message.", "#0078D4");

if (success)
{
    Console.WriteLine("Message sent successfully to Teams!");
}
else
{
    Console.WriteLine("Message sending failed to Teams.");
}

Replace "your_teams_webhook_url" with your actual Teams webhook URL and "optional_channel_name" with the desired channel name, if applicable.

Remember to customize the message content, title, summary, and theme color as needed for your use case.

For more information on Teams message formatting, refer to the Microsoft Teams documentation.

Slack

To send messages to Slack using the SlackService, follow these steps:

  1. Install the WebhookSenderHub NuGet package.
  2. Create an instance of the SlackService class with the webhook URL and optional channel name.
  3. Use the various SendAsync methods to send messages to Teams.

Here's an example of sending a message to Teams:

using WebhookSenderHub;

IMessagingService messagingService = new SlackService("your_slack_webhook_url", "optional_channel_name");

bool success = await messagingService.SendAsync("Hello from WebhookSenderHub!", "Webhook Message", "This is a sample message.");

if (success)
{
    Console.WriteLine("Message sent successfully to Slack!");
}
else
{
    Console.WriteLine("Message sending failed to Slack.");
}

Discord

To send messages to Discord using the DiscordService, follow these steps:

  1. Install the WebhookSenderHub NuGet package.
  2. Create an instance of the DiscordService class with the webhook URL and optional channel name.
  3. Use the various SendAsync methods to send messages to Teams.

Here's an example of sending a message to Teams:

using WebhookSenderHub;

IMessagingService messagingService = new DiscordService("your_discord_webhook_url");

bool success = await messagingService.SendAsync("Hello from WebhookSenderHub!", "Webhook Message", "This is a sample message.", "#FF5733");

if (success)
{
    Console.WriteLine("Message sent successfully to Discord!");
}
else
{
    Console.WriteLine("Message sending failed to Discord.");
}

Contributing

Contributions are welcome! Feel free to submit issues, pull requests, or feedback in the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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.2 216 10/30/2023
1.0.1 122 10/30/2023
1.0.0 255 9/4/2023