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" />
<PackageReference Include="Naravel.Notifications.Mail" />
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#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
#tool nuget:?package=Naravel.Notifications.Mail&version=0.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Naravel.Notifications.Mail
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'srouteNotificationForMail()andtoMail(). - Naravel.Mail's rules apply. The message goes out with
PendingMail, so the mailer's defaultFromand the address validation apply, and an invalid address fails the channel. - Fails loudly. A
mailabledelegate that returnsnullthrows anInvalidOperationException, 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.
Related packages
| 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
- Notifications: English guide
- Mail: English guide
- Changelog · Source and issues · MIT license
Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.
| Product | Versions 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.
-
net10.0
- Naravel.Mail (>= 0.2.0)
- Naravel.Notifications (>= 0.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Release notes: https://github.com/km-arc/Naravel/releases/tag/v0.2.0 - full history: https://github.com/km-arc/Naravel/blob/main/CHANGELOG.md