Soenneker.Email.Senders.Resend
11.0.900
Prefix Reserved
dotnet add package Soenneker.Email.Senders.Resend --version 11.0.900
NuGet\Install-Package Soenneker.Email.Senders.Resend -Version 11.0.900
<PackageReference Include="Soenneker.Email.Senders.Resend" Version="11.0.900" />
<PackageVersion Include="Soenneker.Email.Senders.Resend" Version="11.0.900" />
<PackageReference Include="Soenneker.Email.Senders.Resend" />
paket add Soenneker.Email.Senders.Resend --version 11.0.900
#r "nuget: Soenneker.Email.Senders.Resend, 11.0.900"
#:package Soenneker.Email.Senders.Resend@11.0.900
#addin nuget:?package=Soenneker.Email.Senders.Resend&version=11.0.900
#tool nuget:?package=Soenneker.Email.Senders.Resend&version=11.0.900
Soenneker.Email.Senders.Resend
Renders EmailMessage payloads with Scriban templates and delivers them through the Resend API.
Install
dotnet add package Soenneker.Email.Senders.Resend
Resource layout
LocalResources/
Email/
Templates/
default.html
Contents/
welcome.html
Paths are resolved beneath the application's output directory. TemplateFileName defaults to default.html; ContentFileName is optional and, when supplied, is rendered into the outer template as bodyText. Absolute paths and traversal outside the template or content root are rejected.
Message tokens and partials become Scriban globals. The sender always sets the subject token from EmailMessage.Subject, replacing a caller-supplied token with that name.
Configuration
{
"Email": {
"Enabled": true,
"DefaultAddress": "mailer@example.com",
"DefaultName": "Example App"
},
"Resend": {
"ApiKey": "use-a-secret-provider"
}
}
All four values are required when resolving the sender. Keep the API key in a secret provider.
Registration
using Soenneker.Email.Senders.Resend.Registrars;
services.AddResendEmailSenderAsSingleton();
This registers IEmailSender, the Resend email utility/client, and the template utility as singletons.
For request-scoped rendering, use:
services.AddResendEmailSenderAsScoped();
That registration makes the sender, email utility, and template utility scoped while deliberately retaining the Resend client utility as a singleton. Disposing a scope tears down the wrapper utilities without recreating or disposing the shared HTTP client on every request.
Send an email
using Soenneker.Email.Senders.Abstract;
using Soenneker.Enums.Email.Format;
using Soenneker.Enums.Email.Priority;
using Soenneker.Messages.Email;
var message = new EmailMessage
{
Type = "email.welcome.v1",
Id = Guid.NewGuid().ToString("N"),
Queue = "email",
Sender = "accounts-api",
CreatedAt = DateTimeOffset.UtcNow,
To = ["recipient@example.net"],
Subject = "Welcome, Alex",
Format = EmailFormat.Html,
Priority = EmailPriority.Normal,
ContentFileName = "welcome.html",
Tokens = new Dictionary<string, string> { ["first_name"] = "Alex" }
};
IEmailSender sender = serviceProvider.GetRequiredService<IEmailSender>();
bool accepted = await sender.Send(message, cancellationToken);
HTML messages are sent through Resend's html field; plaintext messages use its text field. Name and Address fall back to the configured defaults, and ReplyTo, To, Cc, and Bcc are forwarded. Priority is not mapped because this adapter does not send a priority field to Resend.
The result is true only when Resend returns a provider email ID. It is false when email is disabled or the provider response has no ID. API, rendering, configuration, and deserialization failures are raised as exceptions.
The string overload always deserializes messageContent as EmailMessage; the accompanying type is transport metadata and does not select an arbitrary CLR type.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Email.Senders.Abstract (>= 11.0.243)
- Soenneker.Extensions.Dictionaries.StringString (>= 11.0.46)
- Soenneker.Resend.Emails (>= 11.0.459)
- Soenneker.Utils.Json (>= 11.0.2814)
- Soenneker.Utils.Template (>= 11.0.482)
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 |
|---|---|---|
| 11.0.900 | 0 | 12/2/2026 |
| 11.0.899 | 0 | 12/2/2026 |
| 11.0.898 | 0 | 12/2/2026 |
| 11.0.897 | 0 | 12/2/2026 |
| 11.0.896 | 0 | 12/2/2026 |
| 11.0.895 | 0 | 12/1/2026 |
| 11.0.894 | 47 | 12/1/2026 |
| 11.0.893 | 41 | 12/1/2026 |
| 11.0.892 | 44 | 12/1/2026 |
| 11.0.891 | 56 | 12/1/2026 |
| 11.0.890 | 51 | 12/1/2026 |
| 11.0.889 | 61 | 12/1/2026 |
| 11.0.888 | 58 | 12/1/2026 |
| 11.0.887 | 62 | 12/1/2026 |
| 11.0.886 | 67 | 11/30/2026 |
| 11.0.885 | 66 | 11/30/2026 |
| 11.0.884 | 84 | 11/30/2026 |
| 11.0.883 | 72 | 11/30/2026 |
| 11.0.882 | 76 | 11/30/2026 |
| 11.0.881 | 68 | 11/30/2026 |
Updated Multiple NuGet packages