lettermint/lettermint-laravel
Official Laravel integration for Lettermint that adds a mail transport driver, letting you send transactional email through Lettermint's API with Laravel's Mail and Notification systems. Just add your API token, configure the mailer, and send.
composer require lettermint/lettermint-laravel
php artisan vendor:publish --tag="lettermint-config"
.env:
LETT ERMINT_API_KEY=your-api-key
LETT ERMINT_WEBHOOK_SECRET=your-webhook-signing-secret
config/mail.php:
'mailers' => [
'lettermint' => [
'transport' => 'lettermint',
],
],
and set MAIL_MAILER=lettermint.Where to look first: read config/lettermint.php (or the published config/lettermint.php) to see the API key, base URL, and webhook settings, then check the package README for the webhook route registration and event names. The service provider wires the transport and registers the webhook endpoint, so most day-to-day work happens in your existing app/Mail mailables and a webhook controller/listener.
First use case: send a standard Mailable through the new transport — nothing else changes:
Mail::to($user)->send(new WelcomeEmail($user));
Once that works, wire up the webhook endpoint so delivery/open/bounce events from Lettermint flow into your app.
Mail facade. Keep using Mailables and Notifications exactly as before; the package only swaps the transport. This is the lowest-risk way to adopt it — no changes to your mail classes, just the mailer config.Lettermint facade. Treat it as the escape hatch when the mail transport abstraction is too narrow.Message-ID, custom X- headers), or forward to observability tooling.smtp/ses configured alongside lettermint and select per-mail via Mail::mailer('lettermint')->to(...) — useful for staged rollouts or routing different notification classes through different providers.Mail::fake() continues to work; assert on the mailable as usual. For webhook tests, post signed payloads to the endpoint and assert your listeners/jobs ran; use the package's signing helper or replicate the HMAC if exposed.ShouldQueue (or Mail::queue) as normal — the package's HTTP calls to the API happen inside the queued job, so retries/backoff are governed by your queue worker config.json column), verify the added field doesn't break strict schemas or snapshot tests. Don't assume the header key is present on every event — check the event's accessor/property rather than reading an array key blindly.bootstrap/app.php / VerifyCsrfToken $except) — a 419 from Laravel looks like an outage to the provider and triggers retries.config/mail.php or config/lettermint.php, run php artisan config:clear (and remember config:cache in production). A stale config cache is the most common "why is it still using SMTP?" cause.transport value in config/mail.php must match what the package registers. If you get "Transport [lettermint] is not defined," the service provider isn't loaded (check package discovery / composer dump-autoload) or you're on a cached config.LETT ERMINT_API_KEY often surfaces as a 401 at send time rather than at boot. Add a config/boot check or an assertion in your deploy health check.Log the provider response and message ID on failure; enable the package's debug logging if available. For webhook issues, log the raw body before verification so you can distinguish "bad signature" from "malformed payload."$mailable->withSymfonyMessage(...) / headers()) — and with 3.1.0 you can confirm what actually went out by inspecting the headers on the outbound event.How can I help you explore Laravel packages today?