- Is gushphp/to-inline-style-email-bundle compatible with Laravel?
- No. It is a Symfony2 bundle built around Symfony bundle classes, DI extension wiring, and service definitions, none of which Laravel uses. Laravel ignores Symfony bundles entirely, so there is no service provider, auto-discovery, or publishable configuration. The only portable capability is the underlying tijsverkoyen/css-to-inline-styles library.
- Can I install gushphp/to-inline-style-email-bundle in a Laravel 9, 10, or 11 app?
- A clean Composer install into a modern Laravel app is unlikely to succeed. The bundle targets Symfony 2.x components, old PHP upper bounds, and the SwiftMailer era, while Laravel 9+ ships Symfony Mailer. Pinning old Symfony components to satisfy it would be a security and maintenance net negative.
- What does gushphp/to-inline-style-email-bundle actually do?
- It wraps the CssToInlineStyles converter by Tijs Verkoyen and integrates it into Symfony2's mail lifecycle. Its purpose is to move CSS from style blocks into inline style attributes so HTML emails render more reliably in Gmail, Outlook, and other clients. The useful conversion logic lives in the framework-agnostic dependency, not in the Symfony bundle glue.
- What is the best Laravel alternative to this Symfony bundle?
- Require tijsverkoyen/css-to-inline-styles directly, or use Laravel's built-in Markdown mail inlining, which already uses that library. If you need custom behavior, implement a small MessageSending listener or a Mailable helper that runs the converter on the HTML body before sending. Do not install the Symfony bundle just to reach the underlying library.
- How do I inline CSS in Laravel mailables without this bundle?
- Add tijsverkoyen/css-to-inline-styles as a direct Composer dependency and call it from a Mailable build or render hook, or from a MessageSending event listener. The listener can transform the HTML body before the message is sent while leaving attachments, headers, and the plain-text alternative intact. This keeps the integration at your application boundary and avoids obsolete Symfony or SwiftMailer wiring.
- Does Laravel already include CSS inlining for emails?
- Yes, for Markdown mail. Laravel's Markdown mail pipeline already depends on tijsverkoyen/css-to-inline-styles and uses it to inline styles in rendered email HTML. If you use Markdown mailables, you typically do not need this bundle or a separate adapter. For custom HTML mailables, you can call the same library directly.
- Is gushphp/to-inline-style-email-bundle maintained and safe for production?
- It has been abandoned since June 2017 and has no active security response process, compatibility maintenance, or issue triage. It was built for Symfony2 and SwiftMailer, both of which are long past end of life. For production Laravel work, use the maintained underlying library or Laravel's native mail inlining instead.
- What Composer constraints does this bundle have and will they conflict with modern Laravel?
- The bundle is tied to Symfony 2.x components, older PHP version bounds, and the SwiftMailer era. Those constraints conflict with Laravel 8+ and PHP 8.x, and dependency resolution risk will only increase over time. There is no Laravel auto-discovery, service provider, or publishable config to smooth the integration.
- Can I reuse the bundle's adapter code in a Laravel application?
- You can use the repository as a design reference, but you should not depend on the bundle. The portable part is a thin adapter that runs CssToInlineStyles over the HTML part of a message before send. Reimplement that as a roughly 30-line Laravel listener or Mailable helper and write your own tests against current library versions.
- How does the bundle hook into email sending and is that portable to Laravel?
- Its integration is Symfony2 and SwiftMailer specific, such as a Swift plugin or mail event listener, not a Laravel mail hook. Laravel 9+ uses Symfony Mailer, so any SwiftMailer-based hook is structurally obsolete. In Laravel, reimplement the behavior as a MessageSending listener or a mailer decorator around the underlying CSS inliner.