hautzi/system-mail-bundle
Symfony bundle for sending system-generated emails with configurable templates and mail transport integration. Use a simple service API to dispatch transactional notifications, confirmations, and other automated messages from your application.
Headline finding: this is not a Laravel package. hautzi/system-mail-bundle is a Symfony bundle. It ships a *Bundle class registered through Symfony's kernel, relies on Symfony's DI container and compiler passes, and (circa 2018) almost certainly targets Swiftmailer plus Doctrine ORM entity mapping. Laravel uses Symfony components (symfony/mailer, symfony/console, symfony/http-foundation) but not the framework — there is no bundle loader, no config/bundles.php, no autowired compiler-pass lifecycle. Direct installation via Composer will "succeed" and produce nothing usable.
Architecture fit — poor. The value proposition is narrow and well-defined: a service that resolves and sends localized "system mails" (password reset, welcome, receipt) from stored templates, selecting the template by code + recipient locale with fallback. That concept fits Laravel cleanly; the implementation does not. Laravel already covers most of the capability natively: Mailable::locale() sets the locale for a single send, lang/{locale}/ files hold translations, and Mail::to()->locale()->send() handles the fallback chain. The bundle's only genuine differentiator is database-backed, admin-editable templates — that is the piece worth porting, and it is maybe 200 lines of Laravel code.
Integration feasibility — low as-is, moderate as a re-implementation. Effort to make the bundle load in Laravel: not viable at any reasonable cost. Effort to port the concept: 1–2 sprints for a single engineer including tests, admin UI optional.
Technical risk — high, and mostly not about functionality:
Key questions to resolve before any decision:
lang files would not?Recommendation: do not adopt. Do not fork either — owning an abandoned Symfony bundle inside a Laravel codebase is a permanent tax. Port the schema and resolver contract, not the code.
Stack fit. Target Laravel 10/11 on PHP 8.2+, symfony/mailer via Laravel's Mail facade, Blade or Markdown mailables, queue-backed sending. The only artefact carried over from the bundle should be its data model and resolution semantics.
Proposed port shape:
system_mails table: code (e.g. auth.password_reset), locale, subject, body_html, body_text, version, updated_by, timestamps. Unique index on (code, locale).SystemMailTemplate Eloquent model with a render(array $params) method.SystemMailer service: send(string $code, array $params, Notifiable $to, ?string $locale = null) — resolves the template, walks the fallback chain, throws a loud MissingMailTemplateException rather than silently degrading (unless the fallback chain explicitly terminates in a configured default locale).SystemMailMessage Mailable that accepts rendered subject/body and sets ->locale() so Laravel's own translation layer handles any residual strings.{{ $user->name }}, {{ $action_url }}) — not arbitrary Blade.Migration path. There is no data to migrate from the Symfony bundle — no dependents exist and we are not running it. The real migration is from whatever we do today: hardcoded mailables, hardcoded English strings, or ad-hoc lang files.
Compatibility. Laravel's mail API is stable across 10/11; Symfony Mailer transport config is unchanged. The one compatibility trap is queue serialization of a Mailable holding rendered HTML — keep the Mailable small and re-render inside the job if the payload grows.
Sequencing.
lang files and ->locale(). Measure how much pain remains.Maintenance. This is the dominant cost and the reason to decline the dependency. A fork means owning a Symfony bundle's worth of code forever, in a codebase where no one has Symfony framework expertise. The ported version is smaller but still ours: template rendering, fallback semantics, and the admin surface all become internal products requiring owners, tests, and documentation.
Support. Zero upstream support. The repository's last commit predates the Swiftmailer removal, so any issue found in the original code has no path to a fix. Our ported version is supported by whichever team owns transactional messaging — name that team before starting.
Scaling. Effectively a non-issue. Email sending is I/O-bound and low-volume relative to typical Laravel workloads. Put sends on a queue, cap concurrency against the SMTP provider's rate limit, and the template resolution (one indexed DB read per send) is noise. Cache resolved templates per (code, locale) with invalidation on write if volume ever justifies it — it likely never will.
Failure modes to design against:
code has every supported locale), fall back with an alert in production, and log the degraded send.Ramp-up. Low for the ported version — any Laravel developer can pick up an Eloquent model, a service class, and a Blade view in a day. High, bordering on unacceptable, for the original bundle: it would require Symfony DI literacy that this team has no other reason to hold.
Bottom line. The problem the package names is real and recurring; the package itself is not the answer in a Laravel codebase. Spend one week proving that native Laravel mailables plus lang files are insufficient, and only then build the small internal template layer the concept actually requires.
How can I help you explore Laravel packages today?