PHPackages                             agirem/clario-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. agirem/clario-laravel

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

agirem/clario-laravel
=====================

Laravel Mail transport and webhook consumer for the Clario email API.

v0.1.0(today)00MITPHPPHP ^8.2

Since Aug 8Pushed todayCompare

[ Source](https://github.com/Agirem/clario-laravel)[ Packagist](https://packagist.org/packages/agirem/clario-laravel)[ Docs](https://github.com/Agirem/clario-laravel)[ RSS](/packages/agirem-clario-laravel/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (7)Versions (2)Used By (0)

agirem/clario-laravel
=====================

[](#agiremclario-laravel)

Laravel Mail transport and optional webhook consumer for the [Clario](https://clario-mail.com) email API.

Send with familiar Laravel Mailables:

```
Mail::to($user)->send(new OtpCodeMail($code));
```

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12
- Clario API access (active trial, Solo, or Pro)
- API key with `emails:send`

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

[](#installation)

```
composer require agirem/clario-laravel
```

Publish config (optional):

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

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

[](#configuration)

`.env`:

```
MAIL_MAILER=clario
CLARIO_API_KEY=clario_live_...
# Optional when Laravel From matches a Clario address:
# CLARIO_MAIL_ADDRESS_ID=01HX...
CLARIO_BASE_URL=https://clario-mail.com/api/v1
```

`config/mail.php`:

```
'clario' => [
    'transport' => 'clario',
],
```

### Sender resolution

[](#sender-resolution)

The transport sends either `mail_address_id` or `from` to the Clario API, in this order:

1. Message header `X-Clario-Mail-Address-Id` → `mail_address_id`
2. Map `config('clario.mail_addresses')[from@email]` → `mail_address_id`
3. Default `CLARIO_MAIL_ADDRESS_ID` → `mail_address_id`
4. Laravel / Symfony `From` address → `from` (API resolves the mailbox)

Display name is configured on the Clario address, not via Laravel `from.name`.

Idempotency (important for queued mail)
---------------------------------------

[](#idempotency-important-for-queued-mail)

Every send includes an `Idempotency-Key`. Prefer a stable business key on critical mailables:

```
public function headers(): Headers
{
    return new Headers(
        text: [
            'X-Clario-Idempotency-Key' => 'otp-'.$this->user->id.'-'.$this->codeId,
        ],
    );
}
```

If omitted, the transport hashes the rendered message (stable across worker retries of the same content).

Attachments
-----------

[](#attachments)

Attachments are sent as `multipart/form-data`. Limits match the API: max 10 files, 5 MB each, allowed MIME types (PDF, JPEG/PNG/GIF, Word, Excel, CSV, plain text).

Webhooks (optional)
-------------------

[](#webhooks-optional)

```
CLARIO_WEBHOOKS_ENABLED=true
CLARIO_WEBHOOK_SECRET=whsec_...
CLARIO_WEBHOOK_PATH=clario/webhook
```

Point your Clario Developer webhook to `https://your-app.test/clario/webhook`.

Events dispatched:

- `Clario\Laravel\Webhooks\Events\EmailQueued`
- `EmailSent`, `EmailDelivered`, `EmailBounced`, `EmailFailed`
- `EmailComplained`, `EmailOpened`, `EmailClicked`, `EmailReceived`

```
Event::listen(EmailDelivered::class, function (EmailDelivered $event) {
    // $event->emailId, $event->data['metadata'], $event->eventId
});
```

Signatures use `Clario-Signature: t=…,v1=…` (HMAC-SHA256 of `timestamp.rawBody`). Invalid signatures return `401`.

The route uses the `api` middleware group (no CSRF).

Metadata
--------

[](#metadata)

```
public function headers(): Headers
{
    return new Headers(text: [
        'X-Clario-Metadata-order_id' => (string) $this->order->id,
    ]);
}
```

Exceptions
----------

[](#exceptions)

`Clario\Laravel\Exceptions\ClarioTransportException` exposes:

- `statusCode`, `errorCode`, `requestId`
- `retryable` — useful for queue `$this->release()` vs fail

Non-retryable examples: `pro_plan_required`, `sender_not_allowed`, quota exceeded, `idempotency_conflict`.

Testing
-------

[](#testing)

```
composer install
composer test
```

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/63335461?v=4)[OUSMANE MERIGA](/maintainers/Agirem)[@Agirem](https://github.com/Agirem)

---

Top Contributors

[![Agirem](https://avatars.githubusercontent.com/u/63335461?v=4)](https://github.com/Agirem "Agirem (3 commits)")

---

Tags

laravelmailemailmailerwebhooksclario

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)[illuminate/mail

The Illuminate Mail package.

5910.7M559](/packages/illuminate-mail)[api-platform/laravel

API Platform support for Laravel

58190.1k19](/packages/api-platform-laravel)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)

PHPackages © 2026

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