mailjet/mailjet-swiftmailer
mailjet/mailjet-swiftmailer adds a Mailjet transport to Swift Mailer, letting PHP apps send transactional and bulk email through Mailjet's API. Existing Swift Mailer workflows keep building messages while Mailjet handles delivery, tracking, and scaling.
Architecture fit — poor for current Laravel, acceptable only on legacy stacks. This package is a single-purpose SwiftMailer transport (Mailjet\Transport\MailjetTransport) that wraps Mailjet's API v3 PHP SDK (mailjet/mailjet-apiv3-php) to send mail over HTTPS instead of SMTP. Laravel 9 (Feb 2022) replaced SwiftMailer with Symfony Mailer, so the package is architecturally incompatible with the framework's current mail pipeline (Symfony\Component\Mailer\Transport\TransportInterface). It is only a natural fit for Laravel ≤8.x via a custom transport registration in a service provider (Mail::extend / MailManager::extend). Laravel 8 left security support in January 2023, meaning the only architecture this package cleanly fits is itself out of support.
Integration feasibility — moderate effort, low value. The library is small (essentially one transport class plus a composer dependency) and MIT-licensed, so vendoring or forking is trivial. Two integration options exist:
| Option | Effort | Fit |
|---|---|---|
| Mailjet SMTP (no package) | Hours — config only (smtp.mailjet.com:587, API key/secret as credentials) |
Works on every Laravel version |
| This SwiftMailer transport | Days — custom transport, DI wiring, tests | Laravel ≤8 only |
symfony/mailjet-mailer bridge or direct v3 API wrapper |
Days — custom transport / queued job | Laravel 9+ |
Given that Mailjet's SMTP endpoint provides the same delivery path with zero third-party code, the package's only genuine advantage is API-based sending (useful when outbound SMTP ports are blocked or when you want structured API error payloads).
Technical risk — high, and mostly unrelated to Mailjet. The dominant risk is the abandoned SwiftMailer foundation (EOL Nov 2021, no security patches), compounded by a package last released 2019-06-13, 25 stars, and 0 dependents — meaning effectively no field-proven usage and no community regression signal. Concretely: no PHP 8.1/8.2/8.3 compatibility guarantee, deprecation noise from SwiftMailer internals, no dependency updates in five years, and no maintainer response path if the Mailjet API contract shifts. The Mailjet API v3 itself is stable, so the transport logic is unlikely to break from Mailjet's side — the breakage vector is PHP/framework upgrades behind it.
Key questions for the vendor/team:
Stack fit. Target stack assumption: PHP 8.x, Laravel 10/11, queued mail. On that stack this package does not fit at all — SwiftMailer is not present. Recommendation: do not adopt for any Laravel ≥9 application. For legacy Laravel 7/8 applications, it is a viable but time-boxed bridge.
Migration path (recommended, in priority order):
config/mail.php at Mailjet SMTP with API key/secret credentials, MAIL_MAILER=smtp, TLS on 587, and reuse existing Laravel mailables, notifications, and Markdown templates unchanged. This satisfies ~95% of use cases with zero new dependencies.symfony/mailjet-mailer or mailjet/mailjet-apiv3-php behind a TransportInterface implementation), wired through Mail::extend() with a DSN in config/mail.php. Keep it in app/Support/Mail/ so it is testable and swappable.MailServiceProvider, constructor-injected with keys from config/services.php (never hardcoded), and pin the exact version in composer.json with a provide/replace note.Compatibility. Verify PHP constraint versus the app's PHP version before anything else; the 2019 release predates PHP 8.1. Lock mailjet/mailjet-swiftmailer and its mailjet/mailjet-apiv3-php and swiftmailer/swiftmailer transitive versions, and add a Composer conflict guard so a future framework upgrade fails loudly rather than silently breaking mail.
Sequencing.
Mail::send, third-party packages that ship their own mailers).Maintenance. The package is a permanent maintenance liability: no upstream fixes, and the transitive SwiftMailer dependency is EOL. Assume you own the code. Budget a fork in a private VCS with a CI matrix over supported PHP versions, plus a quarterly review triggered by PHP minor releases. If you choose the SMTP route instead, recurring maintenance drops to near zero — this asymmetry should drive the decision.
Support. No vendor support, no issue triage, 0 dependents means no community knowledge base. Mailjet support will not debug a third-party SwiftMailer transport. Internal support model must be "one named owner + runbook," and that owner must be able to read SwiftMailer internals.
Scaling. The transport issues one HTTPS API call per message, so throughput is bounded by Mailjet's per-endpoint rate limits and HTTP round-trip latency, not by your PHP workers. Synchronous sending is therefore not viable above low volume — mail must go through queues with concurrency tuned conservatively to avoid 429s. The transport does not implement retry/backoff, so burst behavior degrades into queue retries. Bulk campaigns should bypass this path entirely in favor of Mailjet's batch/campaign APIs.
Failure modes to instrument:
failed_jobs payloads.Ramp-up. Low technical ramp-up (one class, well-understood pattern) but high conceptual debt: engineers under ~30 will have no SwiftMailer familiarity, and the abstraction leaks legacy idioms into new code. Onboarding cost is better framed as "one more thing to learn that we intend to delete." Net recommendation: reject as a strategic dependency; use Mailjet SMTP for immediate need and a Symfony Mailer-based custom transport if API-send becomes a hard requirement.
How can I help you explore Laravel packages today?