PHPackages                             jetemail/jetemail-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. jetemail/jetemail-laravel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

jetemail/jetemail-laravel
=========================

JetEmail for Laravel

00PHP

Since Apr 2Pushed 3mo agoCompare

[ Source](https://github.com/jetemail/jetemail-laravel)[ Packagist](https://packagist.org/packages/jetemail/jetemail-laravel)[ RSS](/packages/jetemail-jetemail-laravel/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

JetEmail Laravel SDK
====================

[](#jetemail-laravel-sdk)

Official Laravel SDK for the [JetEmail](https://jetemail.com) transactional email service.

Installation
------------

[](#installation)

```
composer require jetemail/jetemail-laravel
```

> **Note:** You need to create an account at [jetemail.com](https://jetemail.com) to get a transactional API key before using this SDK.

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

Configuration
-------------

[](#configuration)

Add your transactional API key to your `.env` file:

```
JETEMAIL_API_KEY=your-api-key

```

Optionally publish the config file:

```
php artisan vendor:publish --tag=jetemail-config
```

Laravel Mail Integration
------------------------

[](#laravel-mail-integration)

Use JetEmail as a Laravel mail driver. Add the mailer to your `config/mail.php`:

```
'mailers' => [
    'jetemail' => [
        'transport' => 'jetemail',
    ],
],
```

Set it as your default mailer in `.env`:

```
MAIL_MAILER=jetemail

```

Then use Laravel's standard Mail API:

```
use Illuminate\Support\Facades\Mail;

Mail::to('recipient@example.com')->send(new WelcomeEmail());
```

This works with all Laravel Mailables and Notifications out of the box.

Direct API Usage
----------------

[](#direct-api-usage)

### Send a single email

[](#send-a-single-email)

```
use JetEmail\Laravel\Facades\JetEmail;
use JetEmail\Laravel\Data\SendEmailOptions;

$result = JetEmail::email->send(new SendEmailOptions(
    from: 'you@example.com',
    to: 'recipient@example.com',
    subject: 'Hello!',
    html: 'WelcomeThanks for signing up.',
));

// $result['id'] - the message ID
```

### Send with plain text

[](#send-with-plain-text)

```
$result = JetEmail::email->send(new SendEmailOptions(
    from: 'you@example.com',
    to: 'recipient@example.com',
    subject: 'Hello!',
    text: 'Thanks for signing up.',
));
```

### Multiple recipients, CC, BCC, Reply-To

[](#multiple-recipients-cc-bcc-reply-to)

```
$result = JetEmail::email->send(new SendEmailOptions(
    from: 'you@example.com',
    to: ['alice@example.com', 'bob@example.com'],
    subject: 'Team Update',
    html: 'Here is the latest update.',
    cc: 'manager@example.com',
    bcc: ['logs@example.com'],
    replyTo: 'support@example.com',
));
```

### Attachments

[](#attachments)

```
use JetEmail\Laravel\Data\Attachment;

$result = JetEmail::email->send(new SendEmailOptions(
    from: 'you@example.com',
    to: 'recipient@example.com',
    subject: 'Invoice',
    html: 'Please find your invoice attached.',
    attachments: [
        Attachment::fromPath('/path/to/invoice.pdf'),
        Attachment::fromContent('Hello World', 'hello.txt'),
    ],
));
```

### Custom headers

[](#custom-headers)

```
$result = JetEmail::email->send(new SendEmailOptions(
    from: 'you@example.com',
    to: 'recipient@example.com',
    subject: 'Tracked Email',
    html: 'Hello',
    headers: [
        'X-Campaign-Id' => 'welcome-2024',
    ],
));
```

### Batch send (up to 100 emails)

[](#batch-send-up-to-100-emails)

```
$result = JetEmail::batch->send([
    new SendEmailOptions(
        from: 'you@example.com',
        to: 'alice@example.com',
        subject: 'Hello Alice',
        html: 'Hi Alice!',
    ),
    new SendEmailOptions(
        from: 'you@example.com',
        to: 'bob@example.com',
        subject: 'Hello Bob',
        html: 'Hi Bob!',
    ),
]);

// $result['summary']['successful'] - number of emails sent
// $result['results'] - per-email results
```

### Without the facade

[](#without-the-facade)

```
use JetEmail\Laravel\JetEmail;

$jetemail = app(JetEmail::class);
$jetemail->email->send(new SendEmailOptions(...));
```

### Without Laravel

[](#without-laravel)

```
use JetEmail\Laravel\JetEmail;
use JetEmail\Laravel\Data\SendEmailOptions;

$jetemail = new JetEmail(apiKey: 'your-api-key');
$jetemail->email->send(new SendEmailOptions(
    from: 'you@example.com',
    to: 'recipient@example.com',
    subject: 'Hello!',
    html: 'Hello World',
));
```

Webhooks
--------

[](#webhooks)

JetEmail can send webhook events to your application for email delivery events.

### Setup

[](#setup)

Add your webhook secret to `.env`:

```
JETEMAIL_WEBHOOK_SECRET=your-webhook-secret

```

The webhook endpoint is automatically registered at `POST /jetemail/webhook`. Point your JetEmail dashboard webhook URL to `https://yourdomain.com/jetemail/webhook`.

### Configuration

[](#configuration-1)

You can customize the webhook route prefix and domain:

```
JETEMAIL_PATH=jetemail
JETEMAIL_DOMAIN=webhooks.yourdomain.com

```

### Listening for events

[](#listening-for-events)

Listen for webhook events in your `EventServiceProvider` or using `Event::listen()`:

```
use JetEmail\Laravel\Events\Outbound\MessageDelivered;
use JetEmail\Laravel\Events\Outbound\MessageBounced;
use JetEmail\Laravel\Events\Outbound\MessageOpened;

class EventServiceProvider extends ServiceProvider
{
    protected $listen = [
        MessageDelivered::class => [
            HandleDeliveredEmail::class,
        ],
        MessageBounced::class => [
            HandleBouncedEmail::class,
        ],
    ];
}
```

In your listener:

```
class HandleDeliveredEmail
{
    public function handle(MessageDelivered $event): void
    {
        $payload = $event->payload;

        // $payload['id']      - event ID
        // $payload['type']    - 'outbound.delivered'
        // $payload['from']    - sender
        // $payload['to']      - recipient
        // $payload['subject'] - subject line
        // $payload['mx']      - receiving mail server
    }
}
```

### Available events

[](#available-events)

Event ClassWebhook 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

[](#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):

```
JETEMAIL_WEBHOOK_TOLERANCE=300

```

Error Handling
--------------

[](#error-handling)

```
use JetEmail\Laravel\Exceptions\JetEmailException;

try {
    JetEmail::email->send(new SendEmailOptions(...));
} catch (JetEmailException $e) {
    $e->getMessage();   // Error message
    $e->statusCode;     // HTTP status code
    $e->response;       // Full API error response
}
```

License
-------

[](#license)

MIT

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance55

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7ee01fdcfab283a09020ed94163ad47ba06f2a85abb234fe237f66a1712b9d5?d=identicon)[jetemail](/maintainers/jetemail)

---

Top Contributors

[![jetemail](https://avatars.githubusercontent.com/u/172550771?v=4)](https://github.com/jetemail "jetemail (1 commits)")

### Embed Badge

![Health badge](/badges/jetemail-jetemail-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/jetemail-jetemail-laravel/health.svg)](https://phpackages.com/packages/jetemail-jetemail-laravel)
```

###  Alternatives

[sarfraznawaz2005/noty

Laravel package to incorporate noty flash notifications into laravel.

324.5k](/packages/sarfraznawaz2005-noty)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
