lettr/lettr-laravel Composer package and configuring it to send emails through Lettr. If you haven’t already, start with the Introduction for a quick overview of what the SDK provides.
Requirements
- PHP 8.4 or higher
- Laravel 10.x, 11.x, 12.x, or 13.x
Install the Package
Configuration
Option 1: Interactive Setup (Recommended)
Run the init command for guided configuration:Option 2: Manual Setup
1
Add your API key
Add your Lettr API key to
.env:2
Publish the config file
config/lettr.php with customizable options. See Configuration Options below for a full reference of available settings.3
Add the Lettr mailer
Add the Lettr mailer to This registers Lettr as an available mailer in Laravel’s mail system. You can use it alongside other mailers (e.g.,
config/mail.php:config/mail.php
smtp, log, ses) and choose per-email which one to use.4
Configure sender address
Set your default sender address in
.env. The address must use a verified sending domain:5
Set as default mailer (optional)
To use Lettr as your default mailer, update Or keep your current mailer and use Lettr explicitly when needed:
.env:Configuration Options
Theconfig/lettr.php file contains these options:
config/lettr.php
Verify Installation
Run the check command to verify your installation:Troubleshooting
API key not recognized
API key not recognized
Make sure your
.env file contains LETTR_API_KEY with the lttr_ prefix. Run php artisan config:clear to clear any cached configuration, then try again.Class not found errors
Class not found errors
Run
composer dump-autoload to regenerate the autoloader. If you’re using Laravel’s config cache, run php artisan config:clear as well.Domain verification errors when sending
Domain verification errors when sending
The
from address must use a domain that is verified in your Lettr dashboard. Check that your MAIL_FROM_ADDRESS in .env matches a verified sending domain. See Domain Verification for common issues.Emails not arriving
Emails not arriving
Check your Lettr logs to see if the API accepted the request. If the email was accepted but not delivered, see Delivery Issues for diagnosis steps.
What’s Next
Sending Emails
Learn the different ways to send emails through Lettr
Templates
Work with Lettr-managed templates and merge tags