Laravel SDK
The jetemail-laravel package is the official Laravel SDK for JetEmail transactional email (MIT license). Create a transactional API key in the dashboard: Outbound → Keys → Add API key. Use that key with the SDK.Installation
Configuration
Add your transactional API key to your.env file:
Laravel Mail Integration
Use JetEmail as a Laravel mail driver. Add the mailer to yourconfig/mail.php:
.env:
Direct API Usage
Send a single email
Send with plain text
Multiple recipients, CC, BCC, Reply-To
Attachments
Custom headers
Batch send (up to 100 emails)
Without the facade
Without Laravel
Webhooks
JetEmail can send webhook events to your application for email delivery events.Setup
Add your webhook secret to.env:
POST /jetemail/webhook. Point your JetEmail dashboard webhook URL to https://yourdomain.com/jetemail/webhook.
Configuration
You can customise the webhook route prefix and domain:Listening for events
Listen for webhook events in yourEventServiceProvider or using Event::listen():
Available events
| Event Class | Webhook Type |
|---|---|
Events\Outbound\MessageQueued | outbound.queued |
Events\Outbound\MessageDelivered | outbound.delivered |
Events\Outbound\MessageDeferred | outbound.deferred |
Events\Outbound\MessageBounced | outbound.bounced |
Events\Outbound\MessageRejected | outbound.rejected |
Events\Outbound\MessageSpam | outbound.spam |
Events\Outbound\MessageVirus | outbound.virus |
Events\Outbound\MessageDropped | outbound.dropped |
Events\Outbound\MessageOpened | outbound.opened |
Events\Outbound\MessageClicked | outbound.clicked |
Events\Outbound\MessageComplaint | outbound.complaint |
Signature verification
Webhook signatures are automatically verified whenJETEMAIL_WEBHOOK_SECRET is set. The middleware validates:
- HMAC-SHA256 signature via the
X-Webhook-Signatureheader - Timestamp freshness via
X-Webhook-Timestamp(default: 5-minute tolerance)
Error Handling
For the full source and additional examples, see the GitHub repository.