Get started with the Posta integration
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Posta is a self-hosted email delivery platform. The Community Toolkit provides an AppHost integration that configures Posta with PostgreSQL and Redis, plus a .NET client integration for its application-facing HTTP APIs.
Prerequisites
Section titled “Prerequisites”- An Aspire AppHost project
- PostgreSQL and Redis resources for Posta’s data and queueing
Add Posta to your AppHost
Section titled “Add Posta to your AppHost”Install the 📦 CommunityToolkit.Aspire.Hosting.Posta package in the AppHost. Add Posta with references to its database and Redis resources:
aspire add CommunityToolkit.Aspire.Hosting.Postaimport { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();const postgres = await builder.addPostgres('postgres');const database = await postgres.addDatabase('posta-db', 'posta');const redis = await builder.addRedis('redis');
const posta = await builder.addPostaWithReferences('posta', database, redis);const api = await builder.addProject('api', '../Api/Api.csproj');await api.withReference(posta);
await builder.build().run();aspire add CommunityToolkit.Aspire.Hosting.Postavar builder = DistributedApplication.CreateBuilder(args);var postgres = builder.AddPostgres("postgres");var database = postgres.AddDatabase("posta-db", "posta");var redis = builder.AddRedis("redis");
var posta = builder.AddPosta("posta", database, redis);builder.AddProject<Projects.Api>("api") .WithReference(posta);
// After adding all resources, run the app...builder.Build().Run();The Posta container runs its worker in the main container by default. See Set up Posta in the AppHost for secrets, storage, SMTP settings, and optional endpoints. To register the .NET client, see Connect to Posta.