Soenneker.MsTeams.Sender 11.0.1101

Prefix Reserved
dotnet add package Soenneker.MsTeams.Sender --version 11.0.1101
                    
NuGet\Install-Package Soenneker.MsTeams.Sender -Version 11.0.1101
                    
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="Soenneker.MsTeams.Sender" Version="11.0.1101" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.MsTeams.Sender" Version="11.0.1101" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.MsTeams.Sender" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.MsTeams.Sender --version 11.0.1101
                    
#r "nuget: Soenneker.MsTeams.Sender, 11.0.1101"
                    
#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.
#:package Soenneker.MsTeams.Sender@11.0.1101
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.MsTeams.Sender&version=11.0.1101
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.MsTeams.Sender&version=11.0.1101
                    
Install as a Cake Tool

Soenneker.MsTeams.Sender

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Routes Adaptive Card payloads to named Microsoft Teams HTTPS webhooks.

Installation

dotnet add package Soenneker.MsTeams.Sender

Configuration

Configure the feature switch and one webhook per logical channel:

{
  "MsTeams": {
    "Enabled": true,
    "EngineeringAlerts": {
      "WebhookUrl": "https://example.webhook.office.com/webhookb2/..."
    }
  }
}

The webhook must be an absolute HTTPS URL. Treat it as a credential: keep it in a secret provider, do not commit it to source control, and do not include it in logs. Channel names cannot contain :.

Registration

Choose the sender lifetime that matches how webhook configuration is refreshed:

using Soenneker.MsTeams.Sender.Registrars;

builder.Services.AddMsTeamsSenderAsSingleton();
// or: builder.Services.AddMsTeamsSenderAsScoped();

Both registrations keep the underlying HTTP client cache singleton. A scoped sender can be discarded while the shared client remains available. Each sender caches the first webhook URL resolved for a channel, so a singleton sender requires an application restart to pick up a changed URL; a scoped sender resolves it again in a new scope. The MsTeams:Enabled switch is read on every send.

Send a card

using Soenneker.Dtos.MsTeams.Card;
using Soenneker.MsTeams.Sender.Abstract;

public sealed class DeploymentNotifier(IMsTeamsSender teams)
{
    public Task<bool> Notify(MsTeamsCard card, CancellationToken cancellationToken) =>
        teams.SendCard(card, "EngineeringAlerts", cancellationToken);
}

SendMessage accepts a MsTeamsMessage and reads its MsTeamsCard and Channel fields. SendCard sends the card directly.

The methods return true only for a successful HTTP status. Disabled sending, rate limiting (429), and other non-success responses return false and are logged without response bodies. Configuration errors, serialization failures, transport errors, and cancellation are surfaced as exceptions.

SendMessage disables Hangfire automatic retries through its interface attribute. If delivery must be retried, define an explicit policy that accounts for duplicate webhook delivery and the false result.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.MsTeams.Sender:

Package Downloads
Soenneker.MsTeams.Util

A centralized utility for sending rich, configurable Adaptive Card messages to Microsoft Teams channels via a service bus, with environment-aware filtering and dynamic content generation.

Soenneker.ServiceBus.Receptors.MsTeams

Consumes Microsoft Teams queue messages and enqueues deserialized payloads for Flywheel-backed webhook delivery.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1101 22 11/14/2026
11.0.1100 397 11/11/2026
11.0.1099 108 11/11/2026
11.0.1098 119 11/11/2026
11.0.1096 105 11/11/2026
11.0.1095 111 11/11/2026
11.0.1094 131 11/11/2026
11.0.1093 125 11/11/2026
11.0.1091 147 11/11/2026
11.0.1090 76 11/11/2026
11.0.1089 158 11/10/2026
11.0.1088 746 11/3/2026
11.0.1087 162 11/3/2026
11.0.1086 105 11/3/2026
11.0.1085 90 11/3/2026
11.0.1084 227 11/3/2026
11.0.1083 145 11/3/2026
11.0.1082 112 11/3/2026
11.0.1080 169 11/3/2026
11.0.1079 159 11/2/2026
Loading failed

Update dependency Soenneker.Utils.Json to 11.0.2789 (#1633)