Expand description
The official Lettermint driver for Laravel for Rust: send email through Lettermint, use the Lettermint API, and receive verified webhook events.
The driver builds on the official Lettermint Rust SDK. Its
requests go through Laravel’s HTTP client, so laravel::http::client::fake() fakes them in
tests.
Add the service provider:
use std::process::ExitCode;
use laravel::Application;
use lettermint_laravel::LettermintServiceProvider;
fn main() -> ExitCode {
Application::configure()
.with_providers(|providers| {
providers.add(LettermintServiceProvider);
})
.run()
}Then set MAIL_MAILER=lettermint and LETTERMINT_PROJECT_TOKEN, and send email as usual:
use laravel::mail::{self, Message};
mail::to("jane@example.com")
.send(Message::new().subject("Welcome to Acme").html("<p>Thanks for signing up.</p>"))
.await?;The README is the guide.
Re-exports§
pub use lettermint;
Modules§
- events
- The events the webhook endpoint dispatches.
- webhooks
- The webhook endpoint: verifies each delivery with the SDK and dispatches its events.
Structs§
- Lettermint
Config - The
lettermintconfig section: the API tokens, the request timeout and the webhook endpoint. - Lettermint
Mailer - The settings of one mailer that sends through Lettermint.
- Lettermint
Service Provider - Registers the
lettermintmail driver and mailer, the Lettermint client and the webhook endpoint. - Lettermint
Transport - Sends Laravel email through the Lettermint API, with the Lettermint Rust SDK.
- Options
- Lettermint options for one email, added with
Message::with. - Send
Error - Lettermint didn’t send an email.
- Webhook
Config - The webhook endpoint’s settings.
Enums§
- Config
Error - A configuration problem, found when the mailer is created or a webhook arrives.
Constants§
- DRIVER
- The name of the mail driver, and of the mailer the service provider adds.
Functions§
- build_
client - A Lettermint client built from the config, which sends its requests with Laravel’s HTTP client.
- client
- The application’s Lettermint client, which the service provider registers.
- register
- Registers only the
lettermintmail driver, for an application that configures everything else itself.