Katalyst.Email.Resend 1.0.0

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

Katalyst Email - Resend

.NET library for sending transactional email through Resend using the official Resend .NET SDK. Configuration binds Email:Resend (API key, default sender) and registers IEmailSender.

Requirements

  • .NET 10 SDK
  • A Resend account and API key

Installation

Add the Katalyst.Email.Resend package to your app (from your NuGet feed or a project reference to Email/Email.Resend/Email.Resend.csproj).

dotnet add package Katalyst.Email.Resend

Resend and domain setup

Before the library can send mail, configure Resend and your sending domain.

  1. Create an API key in the Resend dashboard (API Keys). Use a key with permission to send email.
  2. Add and verify a domain in Resend (Domains). Complete DNS records (SPF, DKIM, etc.) until the domain shows as verified.
  3. Choose a “from” address that uses your verified domain, for example noreply@mail.example.com. Resend will reject or fail sends if the domain is not verified or the address is not allowed for your account.
  4. Optional — templates for SendTemplatedAsync: create a template in Resend, publish it, and copy its template UUID from the dashboard.

Official help: Resend documentation.


Configuration

The library reads Email:Resend (see EmailOptions.SectionName). Other email providers can live under sibling paths under Email without colliding with Resend settings.

Setting Description
ApiKey Resend API key (re_...) from the dashboard.
IsApiKeyEncrypted Set to false when ApiKey is the value exactly as shown in the Resend dashboard.
DefaultFrom:Address Default sender email (must align with your verified domain).
DefaultFrom:Name Optional display name for the default sender.

Example appsettings.json:

{
  "Email": {
    "Resend": {
      "ApiKey": "re_xxxxxxxxxxxxxxxxxxxxxxxx",
      "IsApiKeyEncrypted": false,
      "DefaultFrom": {
        "Address": "noreply@mail.yourdomain.com",
        "Name": "Your App"
      }
    }
  }
}

Environment variables override JSON when both are loaded (the development tool merges environment variables after the file). Use the double-underscore form, for example:

  • Email__Resend__ApiKey
  • Email__Resend__IsApiKeyEncrypted
  • Email__Resend__DefaultFrom__Address
  • Email__Resend__DefaultFrom__Name

Using the library (step by step)

  1. Add configuration — Add the Email:Resend section to appsettings.json (or supply the same keys via environment variables / secret store) with a valid ApiKey and DefaultFrom.

  2. Register services — In your host setup, call AddResendEmail with your root IConfiguration:

    using Email.Resend.DependencyInjection;
    
    builder.Services.AddResendEmail(builder.Configuration);
    
  3. Inject IEmailSender — Resolve Email.Resend.Abstractions.IEmailSender in constructors or minimal APIs.

  4. Build a message — Use EmailMessage for plain HTML/text, or TemplatedEmailMessage for a published Resend template (template id must be a GUID string).

  5. Send — Call SendAsync or SendTemplatedAsync. At least one of TextBody or HtmlBody is required for non-template sends; Subject and at least one To recipient are required.

If you omit From on a message, the sender defaults to Email:Resend:DefaultFrom.


Examples

Plain HTML and text email

using Email.Resend.Abstractions;

var message = new EmailMessage(
    Subject: "Welcome",
    To: [new EmailContact("user@example.com", "User Name")],
    TextBody: "Welcome to the app.",
    HtmlBody: "<p>Welcome to the <strong>app</strong>.</p>");

await emailSender.SendAsync(message);

Custom from, CC, and BCC

var message = new EmailMessage(
    Subject: "Invoice ready",
    To: [new EmailContact("customer@example.com")],
    TextBody: "Your invoice is attached in the portal.",
    From: new EmailContact("billing@mail.yourdomain.com", "Billing"),
    Cc: [new EmailContact("finance@yourdomain.com")],
    Bcc: [new EmailContact("archive@yourdomain.com")]);

await emailSender.SendAsync(message);

Resend template (published template UUID)

var message = new TemplatedEmailMessage(
    TemplateId: "00000000-0000-0000-0000-000000000000",
    To: [new EmailContact("user@example.com")],
    TemplateVariables: new Dictionary<string, object>
    {
        ["name"] = "Alex",
        ["resetLink"] = "https://app.example.com/reset?token=..."
    });

await emailSender.SendTemplatedAsync(message);

Replace the GUID with your template’s id from the Resend dashboard.


Development: Email.Resend.Tool

The console app Email/Email.Resend.Tool runs quick send smoke tests against your appsettings.json.

Prerequisites

  • From the repository root (or adjust paths), ensure dotnet can build Email/Email.Resend.Tool.
  • Edit Email/Email.Resend.Tool/appsettings.json in the repo (it is copied to the build output). send and send-template load appsettings.json next to the tool assembly by default, so dotnet run --project Email/Email.Resend.Tool -- send … works from any working directory. Pass --config <path> to use another file. The tool binds Email:Resend the same way as AddResendEmail.

Commands

Command Purpose
send [--config <path>] <to-email> Send a simple test message using configured defaults.
send-template [--config <path>] <template-uuid> <to-email> Send a published template by id.
help Show usage.

Examples

# From repository root
dotnet run --project Email/Email.Resend.Tool -- send you@example.com

dotnet run --project Email/Email.Resend.Tool -- send --config C:\path\to\appsettings.json you@example.com

dotnet run --project Email/Email.Resend.Tool -- send-template 00000000-0000-0000-0000-000000000000 you@example.com

After dotnet build, you can run the executable from Email/Email.Resend.Tool/bin/Debug/net10.0/ with the same arguments (for example Email.Resend.Tool.exe send you@example.com on Windows).


Solution layout

  • Email/Email.Resend — packable library (NuGet id: Katalyst.Email.Resend).
  • Email/Email.Resend.Tool — development CLI (not published as a package).
  • Email/Email.slnx — solution file.
dotnet build Email/Email.slnx
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
1.0.0 151 5/3/2026 1.0.0 is deprecated because it is no longer maintained.