it-blaster/mail-template-bundle
A PHP mail template bundle for managing and rendering reusable email templates. Organize layouts, substitute variables, and keep transactional messages consistent across your app. Simple to integrate and easy to extend.
The first thing to internalize is that it-blaster/mail-template-bundle is a Symfony bundle, not a Laravel package. It ships a *Bundle class, DI extension, and Symfony service configuration — there is no service provider, facade, or config stub that Laravel's container knows how to boot. Day-to-day "leverage" therefore comes in two forms: (a) mining it as a reference implementation for templated transactional mail, or (b) porting its renderer concept into a Laravel package of your own. Direct install-and-go does not exist here.
Where to look first, in order:
composer.json — confirm the Symfony version constraints. Last release is 2016-01-26, so expect Symfony 2.x/3.x era APIs (getContainer, DependencyInjection\Extension, possibly SwiftMailer). These are incompatible with Symfony 5+/6+ and with Laravel's current mail stack.DependencyInjection/ directory — this tells you what services it registers and, more importantly, what collaborators it expects (template locator, renderer, mailer)..env/config/*.php.Your first use case in a Laravel codebase is not "install this bundle." It's "reproduce the pattern": a MailTemplate abstraction that resolves a stored template (DB row, file, or translation key), renders it with data, and feeds it to Mail::send. If you were porting, the bundle's renderer classes are the blueprint; Laravel's Illuminate\Mail\Mailable plus Blade is the destination.
Before committing to anything, verify the repository still resolves under composer require it-blaster/mail-template-bundle at all. Given zero dependents and an eight-year-old release, assume it will not install cleanly against any modern symfony/* constraint without --ignore-platform-reqs, and do not put it in require.
Since direct Laravel integration is off the table, the realistic patterns are around concept adoption and isolated evaluation.
Pattern 1 — Reference for a custom Mailable. Build a TemplateMailable extends Mailable that takes a templateKey and data array, resolves a Blade view from a configurable namespace (e.g. mail-templates::{key}), and renders in build(). This mirrors what the bundle's renderer does but uses Blade's view()->render() or the Content/HtmlString API. You keep Laravel's queue, Mail::fake(), and event hooks for free.
Pattern 2 — DB-backed email templates. A common real-world need the bundle gestures at: templates editable without deploys. In Laravel, store subject, html_body, text_body in an email_templates table, render with Blade::render($html, $data) (Laravel 9+), and pass the result into Mail::html(...) / Mail::raw(...). Sandbox the rendering — DB-sourced Blade is a template-injection surface.
Pattern 3 — Evaluating the bundle as a dependency. Only worth doing if you are maintaining a legacy Symfony app or assessing a migration. Spin it up in a throwaway Symfony skeleton matching its era, wire the bundle in AppKernel, and exercise the renderer via a service. Do not try to shim Symfony's DI into Laravel's container to make it work — the impedance mismatch (service tags, compiler passes, ContainerAwareInterface) will cost more than re-implementing the ~few hundred lines of rendering logic.
Pattern 4 — Test doubles. Whatever you build, keep the renderer behind an interface (EmailTemplateRenderer), bind a fake in tests, and assert on the resolved template key + data rather than on rendered HTML strings. This is the one architectural hint the bundle's mailer/templater split actually encourages, and it survives the port.
Integration tip: if you must run the bundle for archaeology, isolate it in a Docker container with PHP 5.6/7.0 and Symfony 2.8/3.0. Keep it entirely out of the main app's composer.json — a tools/ or reference/ subdirectory with its own composer context works.
services:, parameters:) and AppKernel registration. Translating that to config/services.php + a service provider is manual work with no upstream support.each() (removed in PHP 8), create_function (removed in PHP 8), and pre-7.2 string/array semantics. Expect deprecation noise or fatal errors on modern runtimes.SwiftMailer (\Swift_Message, \Swift_Mailer), which Laravel dropped in favor of Symfony Mailer in Laravel 9. Any port must rewrite the transport layer; do not try to bridge SwiftMailer into modern Laravel..html.twig, .txt.twig, or similar). When porting, be explicit about your namespace and extension conventions rather than inheriting implicit ones.Mail::fake() equivalent. Testing a Symfony-bundle mailer means mocking \Swift_Mailer manually. In your Laravel port, lean on Mail::fake() and Mail::assertSent(TemplateMailable::class, fn ($m) => $m->templateKey === 'welcome') — this is strictly better than what the bundle offers.Mailable + Blade (or Markdown mailables) + optional DB-backed templates with Blade::render. This bundle's contribution is the idea of a pluggable renderer, and that idea is a twenty-line abstraction in Laravel — not a 2016 Symfony bundle.How can I help you explore Laravel packages today?