Download the PHP package beziworld/laravel-emaillabs without Composer
On this page you can find all versions of the php package beziworld/laravel-emaillabs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download beziworld/laravel-emaillabs
More information about beziworld/laravel-emaillabs
Files in beziworld/laravel-emaillabs
Package laravel-emaillabs
Short Description Laravel integration for EmailLabs (Vercom): mail transport, templates, tags and headers, signed delivery webhooks with events, blacklist, statistics and multiple accounts.
License MIT
Homepage https://github.com/beziworld/laravel-emaillabs
Informations about the package laravel-emaillabs
Laravel EmailLabs
Laravel integration for EmailLabs (Vercom): a Laravel Mail transport on the EmailLabs REST API v2.1, stored templates with variables, tags and custom headers, signed delivery, bounce, open and click webhooks dispatched as Laravel events, the blacklist (suppression list), sending statistics and multiple panels and SMTP accounts.
Polska wersja dokumentacji
Features
emaillabsmail transport (Mail::extend): send any Mailable or notification through the API, with per-recipient Message-IDs, Cc, Bcc, Reply-To, attachments and inline images.- Mailable
tag()andmetadata()mapped to EmailLabs tags andX-Metadata-*headers; control headers for the SMTP account, a stored template and its variables. - Direct API:
EmailLabsMessagebuilder with per-recipient variables, global variables and templates. - Templates: list, add, delete (
{{ variable }}, conditions and loops). - Webhook route with
X-Webhook-Checksumverification (SHA1 of secret, date and request ID), optional Basic auth, and events:EmailDelivered,EmailBounced,EmailDropped,EmailDeferred,EmailOpened,EmailClicked,EmailEventReceived,WebhookReceived. - Statuses, opens and clicks of sent messages, aggregated statistics, SMTP account list.
- Blacklist of addresses and domains: list, add, remove, check.
- Multiple panels (named connections, runtime keys per tenant) and multiple SMTP accounts per panel.
- No SDK dependency: Laravel HTTP client, so
Http::fake()works; reads retried on 5xx and 429, sends never repeated. - Typed immutable responses, one exception hierarchy, PHP 8.3+, Laravel 12 and 13, PHPStan level 8.
Why this package
| Package | Status (Packagist, November 2026) |
|---|---|
emaillabs/emaillabs-php-api (50k downloads) |
Official SDK, dev-master only, last change 2018, targets the older v1 API (api.emaillabs.net.pl), no Laravel integration |
sigrun/lelpl (2k) |
dev-master from 2019, wraps the SDK above |
beryldev/laravel-emaillabs (374) |
v1.0.0 from 2016, Laravel 5.2 |
This package targets the current EmailLabs API v2.1 (api.emaillabs.io, Application-Key and Authorization
headers), integrates with Laravel Mail as a Symfony Mailer transport, verifies webhook checksums and turns delivery
reports into events, supports Laravel 12 and 13 and is fully tested.
Installation
Keys are generated in the panel under Account, Settings, API.
Mail transport
Add a mailer to config/mail.php and make it the default (or use it selectively):
Every Mailable, notification and Mail::raw() now goes through the API:
Each "To" recipient receives a separate copy with its own Message-ID (EmailLabs requires unique IDs to match webhook
statuses). The ID of the first recipient becomes the Message-ID of SentMessage; all IDs are in
$transport->lastResult() and in the EmailSent event.
Control headers (removed from the forwarded headers):
| Header | Effect |
|---|---|
X-EmailLabs-Smtp-Account |
send through another SMTP account |
X-EmailLabs-Template |
use a stored template (templateId) |
X-EmailLabs-Vars |
JSON object with template variables (globalVars) |
Other custom headers are passed to EmailLabs unchanged. Inline images ($message->embed()) are referenced by file
name, as EmailLabs expects.
Sending through the API
Templates:
Statuses, opens, clicks and statistics
Status values (EmailStatus): Injected, Ok, Deferred, Softbounce, Hardbounce, Spambounce, Dropped,
Open, Click, with helpers isDelivered(), isBounce(), isPermanentFailure(), isEngagement().
Blacklist
Webhooks
-
Enable the route:
It registers
POST /emaillabs/webhook(routeemaillabs.webhook). -
In the panel (Account, Settings, Webhooks, transactional e-mails) enter the URL, generate the SecretKey and copy it to
EMAILLABS_WEBHOOK_SECRET. With Basic auth enabled, setwebhook_usernameandwebhook_passwordof the connection. - Listen to the events:
The middleware compares X-Webhook-Checksum with sha1("{secret}|{X-Webhook-Date}|{Request-Id}") for the secret of
every connection (and of EmailLabs::resolveWebhookSecretsUsing() for tenants), so the event reports which panel sent
it. The response is always ok with HTTP 200, as EmailLabs requires; EmailLabs waits only 500 ms, so queue slow
listeners. WebhookReceived carries every item of the request, including SMS or push events, which are not mapped.
Opens and clicks arrive only when tracking is enabled for the SMTP account.
Multiple panels and SMTP accounts
php artisan emaillabs:smtp-accounts --connection=marketing lists the SMTP accounts and checks the keys.
Error handling
All exceptions extend Beziworld\EmailLabs\Exceptions\EmailLabsException:
| Exception | When |
|---|---|
ApiException |
EmailLabs rejected the request (errorCode() such as E-0-003, errorTitle(), httpStatus(), uniqId(), errors(), retryAfter(), isRateLimited(), isAuthenticationError(), isValidationError(), isNotFound()) or could not be reached |
InvalidMessage |
missing recipient, sender, subject or content, more than 200 recipients, invalid X-EmailLabs-Vars |
InvalidConfiguration |
missing keys or SMTP account, unknown connection |
The mail transport wraps them in Symfony's TransportException, as Laravel expects.
Reads (GET, OPTIONS) are retried on connection errors, HTTP 5xx and HTTP 429 (honouring Retry-After, at most 60 s).
Sending is never retried automatically: a request that timed out may already have been accepted.
Testing your application
Development
Author
Created and maintained by Kamil Ćwiertnia, beziworld.eu.
- E-mail: [email protected]
- Issues and feature requests: GitHub issues
- Security vulnerabilities: see SECURITY.md
Need an integration? Get in touch through beziworld.eu.
License
MIT. See LICENSE.md. This package is not affiliated with, endorsed by or sponsored by Vercom S.A. or EmailLabs. "EmailLabs" is a trademark of its owner.
All versions of laravel-emaillabs with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.8
illuminate/console Version ^12.0|^13.0
illuminate/contracts Version ^12.0|^13.0
illuminate/events Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/mail Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
symfony/mailer Version ^7.2|^8.0
symfony/mime Version ^7.2|^8.0