Skip to main content

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: OutboundKeys → Add API key. Use that key with the SDK.

Installation

The service provider and facade are auto-discovered by Laravel.

Configuration

Add your transactional API key to your .env file:
Optionally publish the config file:

Laravel Mail Integration

Use JetEmail as a Laravel mail driver. Add the mailer to your config/mail.php:
Set it as your default mailer in .env:
Then use Laravel’s standard Mail API:
This works with all Laravel Mailables and Notifications out of the box.

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:
The webhook endpoint is automatically registered at 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 your EventServiceProvider or using Event::listen():
In your listener:

Available events

Signature verification

Webhook signatures are automatically verified when JETEMAIL_WEBHOOK_SECRET is set. The middleware validates:
  • HMAC-SHA256 signature via the X-Webhook-Signature header
  • Timestamp freshness via X-Webhook-Timestamp (default: 5-minute tolerance)
You can adjust the tolerance (in seconds):

Error Handling


For the full source and additional examples, see the GitHub repository.