Expand description
HTTP client-agnostic Rust bindings for the Lettermint email service.
The crate is split into a transport-agnostic core (Client, Endpoint,
Query) and an optional [reqwest]-backed implementation behind a feature
flag. Bring your own HTTP client by implementing Client.
§Quick start
use lettermint::reqwest::LettermintClient;
use lettermint::*;
let client = LettermintClient::new("your-api-token");
let req = api::email::SendEmailRequest::builder()
.from("sender@example.com")
.to(vec!["recipient@example.com".into()])
.subject("Hello")
.html("<h1>Welcome!</h1>")
.build();
let resp = req.execute(&client).await;§Features
reqwest— enables [crate::reqwest::LettermintClient], a ready-madeClientbacked by thereqwestHTTP crate. No TLS backend is selected by default; pair it with one of the two below.reqwest-native-tls— enablesreqwestwith the OS-native TLS stack.reqwest-rustls— enablesreqwestwithrustls.tracing— emitstracingspans/events around requests and webhook verification.
All features are off by default. If none of the reqwest-* features fit,
implement Client yourself against any HTTP backend.
§Modules
api— endpoint types (e.g.api::email::SendEmailRequest,api::ping::PingRequest). Each implementsEndpoint.webhook— verify HMAC-SHA256 signatures on inbound Lettermint webhook deliveries.testing— predictable scenario addresses for exercising the API without sending real mail.
§Error handling
Calls to Query::execute return QueryError, which distinguishes
transport failures, body (de)serialization, and typed API errors
(Validation, Authentication, RateLimit, Api).
Modules§
- api
- Endpoint definitions for the Lettermint REST API.
- testing
- webhook
- Verify HMAC-SHA256 signatures on inbound Lettermint webhook deliveries.
Enums§
- Query
Error - An error thrown by the
Querytrait.
Constants§
- LETTERMINT_
API_ URL - Default Lettermint API URL.