Using Laravel’s Mail Facade
If you’ve set Lettr as your default mailer, use Laravel’s standard Mail facade:.env and all emails route through Lettr.
If Lettr isn’t your default mailer, specify it explicitly:
Quick Template Sending
Send a Lettr template without creating a Mailable class:'name' => 'John' fills the {{name}} merge tag. See Merge Tags & Template Language for the full syntax.
With additional options:
Using the Lettr Facade
For full control, use the Lettr facade directly. This bypasses Laravel’s mail abstraction and calls the Lettr API with explicit parameters.HTML Email
Plain Text Email
to parameter accepts both a single email string and an array of recipients.
Template Email
When using the Lettr facade, you must provide the
from address explicitly since it doesn’t use Laravel’s MAIL_FROM_ADDRESS config automatically.Email Builder
For complex emails, use the fluent email builder. This gives you access to every option the Lettr API supports in a chainable interface:Response Object
Thesend() method returns a response object with:
Custom Mailable Classes
Create a Mailable that uses Lettr templates:Mailables with Queues
LettrMailable classes work with Laravel’s queue system. To send asynchronously:
ShouldQueue and uses the Queueable trait, as you would with any standard Laravel Mailable.
Attachments
Add attachments to your emails:type parameter should be a valid MIME type. See Attachments for supported types and size limits.
Tracking
Enable open and click tracking:Tags
Tags let you group emails for analytics. You can filter and break down metrics by tag in the Analytics dashboard, and the home dashboard shows per-tag Sent, Opened, and Rate stats automatically. See Tags for the full reference. In most cases you don’t need to set a tag yourself — the Laravel package resolves it automatically using this priority:- Explicit tag — if you call
->tag()on the Mailable, that value wins. - Template slug — if you use
->template('slug'), the server uses the slug as the tag. - Class name — if neither of the above applies, the package generates a kebab-case tag from the Mailable class name (e.g.,
OrderConfirmationbecomesorder-confirmation).
Automatic Tag from Lettr Template
When you use->template('slug') on a LettrMailable, the server automatically uses the template slug as the tag. No code needed — your analytics are grouped by template out of the box. The Emails page in the dashboard shows Sent, Opened, and Rate per template.
Automatic Tag from Mailable Class Name
When sending raw HTML (without a Lettr template) through aLettrMailable, the package auto-generates a kebab-case tag from the class name. For example, OrderConfirmation becomes order-confirmation.
Overriding with Laravel’s tag() Method
Call ->tag('my-tag') on any Mailable to override the automatic tag:
tag() method), they are joined with _ into a single string. The combined string must not exceed 64 characters.
Quick Template Sending
ThesendTemplate method accepts a tag parameter. If omitted, the template slug is used automatically:
Email Builder
Use->tag() on the email builder:
Raw HTML via Lettr Facade
When sending raw HTML via the Lettr facade (sendHtml, sendText), no automatic tag is applied. Set one manually using the email builder with ->tag().
Summary
Testing
Use Laravel’sMail::fake() for testing:
Mail::fake() intercepts all outbound mail, so no real emails are sent during tests. This works identically to testing any other Laravel mailer.
For custom Mailable classes, assert against the class directly:
What’s Next
Templates
Work with Lettr templates, versioning, and projects
Type Safety
Generate enums, DTOs, and Mailables for compile-time safety