Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mail Template Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. 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.
  2. The bundle's DependencyInjection/ directory — this tells you what services it registers and, more importantly, what collaborators it expects (template locator, renderer, mailer).
  3. The mailer/templating service classes — this is the actual value: how it resolves a template name to a rendered body, then hands that body to the mailer.
  4. The README — likely Russian-language ("Mailer + шаблонизатор писем"), sparse, and written for Symfony YAML config, not Laravel .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.

Implementation Patterns

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.

Gotchas and Tips

  • It is not Laravel. The single biggest pitfall: any tutorial you find for this package assumes Symfony YAML config (services:, parameters:) and AppKernel registration. Translating that to config/services.php + a service provider is manual work with no upstream support.
  • Abandonment is the headline risk. Last release January 2016, 2 stars, 0 dependents. There is no security patch path, no PHP 8 compatibility guarantees, and no maintainer to ask. Treat it as read-only source material, not a dependency.
  • PHP version drift. 2016-era code likely uses 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.
  • Mailer coupling. The bundle almost certainly targets 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.
  • Russian-language docs. README and inline comments are likely Russian. Budget time for translation or rely on reading the source directly — the code is the spec here.
  • Template resolution ambiguity. Expect the bundle to resolve template names against a filesystem locator with its own conventions (.html.twig, .txt.twig, or similar). When porting, be explicit about your namespace and extension conventions rather than inheriting implicit ones.
  • No 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.
  • Extension point to mirror: the renderer is the seam. Keep template lookup, rendering, and transport as three separate concerns (as the bundle's "mailer + templater" split implies) so you can swap Blade for Twig, or DB for files, without touching the send path.
  • Verdict for day-to-day use: do not adopt. If you need templated mail in Laravel, the idiomatic stack is 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.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource