UseSend.Webhooks 1.3.2

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

UseSend.Webhooks

NuGet

Webhook signature verification and event parsing for useSend.

Installation

dotnet add package UseSend.Webhooks

Usage

With Dependency Injection (ASP.NET Core)

// Program.cs
builder.Services.AddUseSendWebhooks(builder.Configuration["UseSend:WebhookSecret"]!);

app.MapPost("/webhooks/usesend", async (HttpRequest req, UseSendWebhooks webhooks) =>
{
    var rawBody = await new StreamReader(req.Body).ReadToEndAsync();

    var headers = req.Headers
        .ToDictionary(h => h.Key, h => h.Value.ToString());

    WebhookEvent evt;
    try
    {
        evt = webhooks.ConstructEvent(rawBody, headers);
    }
    catch (WebhookException ex)
    {
        return Results.BadRequest(ex.Message);
    }

    switch (evt.Type)
    {
        case WebhookEventType.EmailDelivered:
            var data = evt.GetData<EmailEventData>();
            Console.WriteLine($"Delivered to: {string.Join(", ", data!.To)}");
            break;

        case WebhookEventType.EmailBounced:
            Console.WriteLine($"Bounced: {evt.GetData<EmailEventData>()?.Id}");
            break;

        case WebhookEventType.ContactCreated:
            Console.WriteLine($"New contact: {evt.GetData<ContactEventData>()?.Email}");
            break;
    }

    return Results.Ok();
});

Signature verification only

var isValid = webhooks.Verify(rawBody, headers);

Security

  • Signatures use HMAC-SHA256(secret, "{timestamp}.{rawBody}") compared with constant-time equality
  • Requests older than 5 minutes are automatically rejected (replay attack prevention)
  • Signature format: v1=<hex> in the X-UseSend-Signature header

Event types

See WebhookEventType for all 20 event type constants across emails, contacts, and domains.

Group Events
Email queued, sent, delivered, delivery_delayed, bounced, rejected, rendering_failure, complained, failed, cancelled, suppressed, opened, clicked
Contact created, updated, deleted
Domain created, verified, updated, deleted
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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.3.2 88 5/29/2026
1.3.1 83 5/28/2026
1.3.0 95 5/28/2026
1.2.0 93 5/28/2026