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
                    
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.Email.Senders.Resend" Version="11.0.900" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Email.Senders.Resend" Version="11.0.900" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Email.Senders.Resend" />
                    
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.Email.Senders.Resend --version 11.0.900
                    
#r "nuget: Soenneker.Email.Senders.Resend, 11.0.900"
                    
#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.Email.Senders.Resend@11.0.900
                    
#: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.Email.Senders.Resend&version=11.0.900
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Email.Senders.Resend&version=11.0.900
                    
Install as a Cake Tool

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

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 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

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
Loading failed

Updated Multiple NuGet packages