Naravel.Notifications.Mail 0.2.0

dotnet add package Naravel.Notifications.Mail --version 0.2.0
                    
NuGet\Install-Package Naravel.Notifications.Mail -Version 0.2.0
                    
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="Naravel.Notifications.Mail" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Naravel.Notifications.Mail" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Naravel.Notifications.Mail" />
                    
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 Naravel.Notifications.Mail --version 0.2.0
                    
#r "nuget: Naravel.Notifications.Mail, 0.2.0"
                    
#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 Naravel.Notifications.Mail@0.2.0
                    
#: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=Naravel.Notifications.Mail&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Naravel.Notifications.Mail&version=0.2.0
                    
Install as a Cake Tool

Naravel.Notifications.Mail

NuGet Downloads .NET 10 License: MIT

Optional Naravel.Notifications adapter: a "mail" channel that delivers a notification through Naravel.Mail.

Fact Detail
Install dotnet add package Naravel.Notifications.Mail
Targets .NET 10
Needs Naravel.Notifications and Naravel.Mail, which NuGet installs with it
Channel mail, or the name you pass as name:

What you get

  • One of several channels. SendAsync(user, notification, ["mail", "log"], ct) runs the channels in the order you name them.
  • Two plain delegates. One reads the address from the recipient and the other builds the Mailable; they replace Laravel's routeNotificationForMail() and toMail().
  • Naravel.Mail's rules apply. The message goes out with PendingMail, so the mailer's default From and the address validation apply, and an invalid address fails the channel.
  • Fails loudly. A mailable delegate that returns null throws an InvalidOperationException, and a transport failure surfaces as the transport's own exception.

Quick start

builder.Services.AddNaravelMail(builder.Configuration);
builder.Services.AddMailNotificationChannel<InvoiceReady>(
    address: c => c.GetRecipient<User>().Email,
    mailable: n => new InvoiceMail(n));

await notifications.SendAsync(user, new InvoiceReady(7), ["mail", "log"], ct);

The message goes through the default mailer, or the one you name with mailer:. User and InvoiceMail are your own types.

Package Adds
Naravel.Notifications One typed notification to a recipient through the channels you name
Naravel.Mail Mailables, named transports and the fake that this channel sends through

Learn more

Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.

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. 
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
0.2.0 95 11/13/2026
0.1.1 103 11/2/2026
0.1.0 106 11/1/2026