Innovabit.DotNet.Interceptors.Notifications.Abstractions 3.0.125

There is a newer version of this package available.
See the version list below for details.
dotnet add package Innovabit.DotNet.Interceptors.Notifications.Abstractions --version 3.0.125
                    
NuGet\Install-Package Innovabit.DotNet.Interceptors.Notifications.Abstractions -Version 3.0.125
                    
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="Innovabit.DotNet.Interceptors.Notifications.Abstractions" Version="3.0.125" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Innovabit.DotNet.Interceptors.Notifications.Abstractions" Version="3.0.125" />
                    
Directory.Packages.props
<PackageReference Include="Innovabit.DotNet.Interceptors.Notifications.Abstractions" />
                    
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 Innovabit.DotNet.Interceptors.Notifications.Abstractions --version 3.0.125
                    
#r "nuget: Innovabit.DotNet.Interceptors.Notifications.Abstractions, 3.0.125"
                    
#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 Innovabit.DotNet.Interceptors.Notifications.Abstractions@3.0.125
                    
#: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=Innovabit.DotNet.Interceptors.Notifications.Abstractions&version=3.0.125
                    
Install as a Cake Addin
#tool nuget:?package=Innovabit.DotNet.Interceptors.Notifications.Abstractions&version=3.0.125
                    
Install as a Cake Tool

Innovabit.DotNet.Interceptors.Notifications.Abstractions

Send notifications when an intercepted method throws, for the Innovabit.DotNet.Interceptors suite. This is the base package; add a channel (...Notifications.Slack and/or ...Notifications.Email) to actually deliver them.

What it provides

  • [NotifyOnException] — dispatch a notification when a method (or any method of a class) throws.
  • INotifier — a delivery channel abstraction (Slack, e-mail, ...).
  • IExceptionNotificationHandler / ExceptionNotificationHandler<TException> — build the message per exception type, with a generic fallback for System.Exception.
  • INotificationDispatcher — picks the most specific handler and fans the message out to every matching channel.
  • Templates — AddTemplates() plus template sources (code, files, embedded resources) so the wording lives outside the code, with a channel specific variant per notifier.
  • INotificationSender — send a notification (templated or not) on demand, outside the exception pipeline.

Install

dotnet add package Innovabit.DotNet.Interceptors.Notifications.Abstractions

Usage

services.AddInterceptors()
    .AddNotifications()
    .AddSlack(o => o.WebhookUrl = "https://hooks.slack.com/services/XXX/YYY/ZZZ")
    .AddHandler<TimeoutExceptionNotificationHandler>();

public class OrderService : IOrderService
{
    [NotifyOnException]                       // notify (all channels) then re-throw
    public Task PlaceAsync(Order order) { ... }
}

[NotifyOnException] supports Rethrow, Severity, Channels, ExceptionTypes and Template. Register a handler for a concrete exception type by deriving from ExceptionNotificationHandler<TException>; the most specific match wins, falling back to the handler for System.Exception.

Templates

Move the wording out of the code and give every channel its own version — a rich HTML e-mail and a one-line Slack message out of the same failure:

services.AddInterceptors()
    .AddNotifications()
    .AddTemplates(o => o.DefaultTemplateName = "house-style")
    .AddTemplatesFromDirectory("Templates")   // {name}[.{channel}].{txt|html}
    .AddTemplatesFromAssembly()               // embedded resources
    .AddTemplate("order-failed",              // ... or in code
        title: "Order failed in {{ Member }}",
        body: "{{ ExceptionMessage }} at {{ OccurredAt:yyyy-MM-dd HH:mm }}");

[NotifyOnException(Template = "order-failed")]
public Task PlaceAsync(Order order) { ... }

Templates/order-failed.Email.html:


<h1>{{ ExceptionType }}</h1>
<p>{{ ExceptionMessage }}</p>

The built-in renderer substitutes {{ Path }} placeholders (dotted paths, an optional :format specifier, HTML-encoded in HTML templates). Add Innovabit.DotNet.Interceptors.Notifications.Templating.Scriban when the wording needs conditionals, loops or filters.

The model of an exception notification exposes Exception, Method, TargetType, Arguments, OccurredAt, Severity and the shortcuts ExceptionType, ExceptionMessage, StackTrace, Member and MachineName.

Sending on demand

The same channels and templates are available outside the exception pipeline:

public class WelcomeService(INotificationSender sender)
{
    public Task WelcomeAsync(Customer customer)
        => sender.SendTemplateAsync("welcome", new { customer.Name, customer.OrderId });
}

Unlike the exception dispatcher — which swallows channel failures so a broken mail server never changes how a method fails — an explicit send attempts every channel and throws an AggregateException with whatever went wrong.

Part of

The Innovabit.DotNet.Interceptors suite — github.com/Innovabit/dotnet-interceptors.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on Innovabit.DotNet.Interceptors.Notifications.Abstractions:

Package Downloads
Innovabit.DotNet.Interceptors.Notifications.Email

E-mail (SMTP) channel for exception notifications using interceptor.

Innovabit.DotNet.Interceptors.Notifications.Slack

Slack channel for exception notifications using interceptor.

Innovabit.DotNet.Interceptors.Notifications.Templating.Scriban

Scriban template engine for the notification templates of Innovabit.DotNet.Interceptors.

Innovabit.DotNet.Interceptors.All

Meta-package: every interceptor concern in the suite (logging, validation, caching, notifications, telemetry, audit, authorization, rate limiting, coordination, feature gates, transactions, retry/timeout/circuit breaker/fallback) in one reference. Providers are separate packages — pick the ones you use.

Innovabit.DotNet.Interceptors.Notifications.Webhook

Generic HTTP webhook channel for interceptor-based exception notifications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.136 64 12/5/2026
3.0.135 286 11/30/2026
3.0.134 181 11/30/2026
3.0.133 181 11/30/2026
3.0.132 189 11/30/2026
3.0.129 176 11/30/2026
3.0.128 184 11/30/2026
3.0.127 205 11/30/2026
3.0.126 188 11/30/2026
3.0.125 191 11/30/2026
3.0.124 202 11/28/2026
3.0.123 179 11/28/2026
3.0.122 309 11/21/2026
2.0.121 251 11/21/2026
2.0.120 243 11/21/2026
2.0.119 293 11/14/2026
2.0.118 265 11/7/2026
2.0.117 274 10/31/2026
2.0.116 260 10/26/2026
2.0.115 248 10/17/2026
Loading failed