Skip to main content

Crate lettermint_rs

Crate lettermint_rs 

Source
Expand description

Lettermint is an HTTP client-agnostic Rust client for the Lettermint email service.

It provides a reqwest implementation that can be initialized and passed into the execute function of a Query. All Endpoint types implement the Query trait.

To use the [reqwest] based client, enable the "reqwest" feature. You can also implement your own client by implementing the Client trait.

§Example:

use lettermint_rs::reqwest::LettermintClient;
use lettermint_rs::*;

let client = LettermintClient::builder()
    .api_token("your-api-token")
    .build();

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;

Modules§

api
testing
webhook

Enums§

QueryError
An error thrown by the Query trait.

Constants§

LETTERMINT_API_URL
Default Lettermint API URL.

Traits§

Client
A trait representing a client which can communicate with a Lettermint instance.
Endpoint
A trait for providing the necessary information for a single REST API endpoint.
ExposeSecret
Expose a reference to an inner secret
Query
A trait which represents an asynchronous query which may be made to a Lettermint client.

Type Aliases§

SecretString
Secret string type.