Integrations
Laravel
Use Hulaki as a Laravel mail transport — Mailables and notifications just work — and receive webhooks as Laravel events.
The hulakimail/laravel package supports Laravel 11 and 12 on PHP 8.2+.
Install
composer require hulakimail/laravel
php artisan vendor:publish --tag=hulakimail-config # optionalConfigure the mailer
Add a mailer to config/mail.php and set your environment:
config/mail.php
'mailers' => [
// ...
'hulakimail' => [
'transport' => 'hulakimail',
],
],.env
MAIL_MAILER=hulakimail
MAIL_FROM_ADDRESS[email protected]
MAIL_FROM_NAME="Acme"
HULAKIMAIL_API_KEY=hm_live_...Sending
Nothing else changes — Mailables, notifications and queued mail go through Hulaki:
use App\Mail\OrderShipped;
use Illuminate\Support\Facades\Mail;
Mail::to($order->customer)->send(new OrderShipped($order));
// Tags and metadata become Hulaki tags/metadata
public function envelope(): Envelope
{
return new Envelope(
subject: 'Your order has shipped',
tags: ['order-shipped'],
metadata: ['order_id' => $this->order->id],
);
}Webhooks as events
Set HULAKIMAIL_WEBHOOK_SECRET to your endpoint’s signing secret and point the webhook endpoint at https://your-app.com/hulakimail/webhook. The package verifies the signature and dispatches a Laravel event per type:
| Webhook type | Laravel event |
|---|---|
| email.sent | EmailSent |
| email.delivered | EmailDelivered |
| email.delivery_delayed | EmailDeliveryDelayed |
| email.bounced | EmailBounced |
| email.complained | EmailComplained |
| email.opened / email.clicked | EmailOpened / EmailClicked |
| email.failed | EmailFailed |
| email.suppressed / email.unsubscribed | EmailSuppressed / EmailUnsubscribed |
| any | WebhookReceived |
use HulakiMail\Laravel\Events\EmailBounced;
use Illuminate\Support\Facades\Event;
Event::listen(function (EmailBounced $event) {
User::where('email', $event->recipient())->update(['email_bounced' => true]);
});Configuration reference
| Env variable | Default | Purpose |
|---|---|---|
| HULAKIMAIL_API_KEY | — | API key with the emails:send scope |
| HULAKIMAIL_TIMEOUT | 30 | Seconds per HTTP request |
| HULAKIMAIL_TRACK_OPENS / _CLICKS | domain default | Force tracking on or off |
| HULAKIMAIL_WEBHOOK_SECRET | — | Enables the webhook route |
| HULAKIMAIL_WEBHOOK_PATH | hulakimail/webhook | Webhook route path |
| HULAKIMAIL_WEBHOOK_TOLERANCE | 300 | Max signature age in seconds |
Something unclear or missing? Tell us.