polifonic/mailer-bundle
Polifonic Mailer Bundle is a lightweight mailer integration for Symfony/PHP applications, providing straightforward configuration and service wiring to help developers send emails from their apps with minimal setup.
This is a Symfony bundle, not a Laravel package — it wraps Twig rendering and SwiftMailer transport into a mailer service. Before anything else, treat that mismatch as the headline finding.
Minimal steps to evaluate it:
composer require polifonic/mailer-bundle in a Symfony app (not Laravel).AppKernel::registerBundles() on Symfony ≤4, config/bundles.php on Symfony 5+.swiftmailer: block) and point the bundle's template path at your Twig mail directory.Resources/config/services.* first — that's where the service ID and constructor arguments live, and it's the only reliable API documentation you'll get for a 1-star repo.For a Laravel developer, the honest first step is: don't install this. The Laravel equivalent is already in core:
Mail::to($user)->send(new WelcomeMail($user));
with WelcomeMail implementing Mailable, ->view('emails.welcome'), and a Blade layout. Everything the bundle does (template + transport) is a Mailable plus config/mail.php.
The patterns worth learning from the bundle, even if you never use it:
Mailable per email type and $this->view(...)->with([...]) in the constructor — never build mail bodies inline in controllers.{% extends %} for the shell (header, footer, unsubscribe) is the direct ancestor of Blade's <x-mail::layout> / @extends('emails.layout'). Copy the convention, not the code.MAIL_MAILER=log|smtp|array in Laravel. Use log locally, array in tests, smtp in prod.Mail facade is fine, but injecting Illuminate\Contracts\Mail\Mailer keeps mailables testable and queue-safe.ShouldQueue for anything triggered by a user request.{{ }} is compatible; {% %} → @if/@foreach), swiftmailer config → mail.php, service wiring → Mailable classes, spool → queue + Mail::fake() in tests.services.yml yourself.{{ var }} autoescapes — fine for text, but if you're injecting pre-rendered HTML you need |raw, which is XSS-adjacent. Prefer passing scalars and letting the template compose.asset() in email. Absolute URLs only; inline your CSS (email clients strip <style> in ways that vary). The bundle won't help with either.ShouldQueue exists.Mail::fake() + assertSent gives you the same visibility in Laravel without sending.Mailable, Blade, and config/mail.php. Adopting the bundle is a net negative.How can I help you explore Laravel packages today?