CommunityToolkit.Aspire.Posta 13.5.1-beta.736

Prefix Reserved
This is a prerelease version of CommunityToolkit.Aspire.Posta.
dotnet add package CommunityToolkit.Aspire.Posta --version 13.5.1-beta.736
                    
NuGet\Install-Package CommunityToolkit.Aspire.Posta -Version 13.5.1-beta.736
                    
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="CommunityToolkit.Aspire.Posta" Version="13.5.1-beta.736" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CommunityToolkit.Aspire.Posta" Version="13.5.1-beta.736" />
                    
Directory.Packages.props
<PackageReference Include="CommunityToolkit.Aspire.Posta" />
                    
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 CommunityToolkit.Aspire.Posta --version 13.5.1-beta.736
                    
#r "nuget: CommunityToolkit.Aspire.Posta, 13.5.1-beta.736"
                    
#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 CommunityToolkit.Aspire.Posta@13.5.1-beta.736
                    
#: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=CommunityToolkit.Aspire.Posta&version=13.5.1-beta.736&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CommunityToolkit.Aspire.Posta&version=13.5.1-beta.736&prerelease
                    
Install as a Cake Tool

Posta client integration

Use this integration to call the Posta HTTP API through an HttpClient configured with Aspire service discovery.

Getting started

dotnet add package CommunityToolkit.Aspire.Posta

Register the client in the consuming project:

builder.AddPostaClient("posta", settings =>
{
    settings.ApiKey = builder.Configuration["Posta:ApiKey"];
});

The hosting resource exposes an Endpoint=... connection string, so an AppHost can use .WithReference(posta).

Calling an API section

The client intentionally covers the application-facing email, template, subscriber-list, health, and information APIs. These areas are exposed through separate interfaces.

using CommunityToolkit.Aspire.Posta.Models.Emails;
using CommunityToolkit.Aspire.Posta.Clients;

public sealed class MailService(IPostaClient posta)
{
    public Task<SendAnEmailResponse?> SendAsync(CancellationToken cancellationToken) =>
        posta.Emails.SendAnEmailAsync(
            new SendAnEmailRequest
            {
                From = "Acme <hello@example.com>",
                To = ["user@example.com"],
                Subject = "Hello",
                Html = "<h1>Hello!</h1>"
            },
            cancellationToken);
}

Path and query parameters are supplied separately and are escaped by the client:

await posta.Emails.GetEmailDetailsAsync(
    new GetEmailDetailsRequest
    {
        Id = emailId
    },
    cancellationToken);

API-key and JWT operations select the appropriate configured credential automatically. A dynamic application-wide implementation can replace CommunityToolkit.Aspire.Posta.Configuration.IPostaCredentialProvider in DI.

For multiple Posta instances, register keyed clients with AddKeyedPostaClient(...) and resolve them through GetRequiredKeyedService<IPostaClient>(key).

Request and response models

Models are grouped by API area under CommunityToolkit.Aspire.Posta.Models, for example Models.Emails, Models.Templates, and Models.SubscriberLists. Reusable nested schemas are under Models.Shared. JSON property names, required members, path parameters, and query parameters follow Posta's OpenAPI document.

Administrative, OAuth, workspace-management, analytics, campaign, and other uncommon APIs are not duplicated in this package. They can still be called through IPostaSectionClient.SendAsync<TResponse> with a custom PostaEndpoint and PostaRequest.

Overriding endpoints

Paths are not embedded in the section clients. Replace IPostaEndpoints, or derive from PostaEndpoints and override only the changed operation:

public sealed class CustomPostaEndpoints : PostaEndpoints
{
    public override PostaEndpoint SendAnEmail { get; } =
        new(HttpMethod.Post, "/custom/v1/emails/send", PostaAuthentication.ApiKey);
}

builder.Services.AddSingleton<IPostaEndpoints, CustomPostaEndpoints>();

Additional documentation

Feedback & contributing

Submit issues and pull requests through the CommunityToolkit.Aspire repository.

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 is compatible.  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
13.5.1-beta.736 21 9/1/2026
13.5.0 99 8/25/2026
13.5.0-beta.731 51 8/24/2026