twig/inky-extra
Twig extension that provides the inky_to_html filter, converting Zurb Inky email templates into responsive, table-based HTML. It brings Inky's component-driven markup to Twig-based apps, letting you write cleaner email layouts that render reliably across mail clients.
Architecture fit. twig/inky-extra is a thin Twig extension that registers the inky_to_html filter, delegating layout compilation to ZURB Inky. Architecturally it is a presentation-layer add-on, not infrastructure: no services, no queues, no schema, no external calls. It fits cleanly into any PHP stack that already renders email views through Twig (the Symfony/Laravel-with-TwigBridge lineage). For a Blade-first Laravel application, it is not a drop-in — it forces a dual-templating decision (scoped Twig environment for emails only, or broader Twig adoption). That is the single most important architectural fork a TPM must resolve before committing.
Integration feasibility. Low-to-moderate. The package is Composer-installable, MIT-licensed, and requires only a Twig Environment with the extension registered. There is no runtime dependency, no migration, and no data-layer impact. The real effort is organizational and configuration-level: standing up a rendering path for emails and deciding how it coexists with Laravel's native Mailable/Blade flow.
Technical risk.
>=3.26.0 and enforce escaping discipline in Twig.Key questions to close before a decision:
Stack fit. Best fit is Symfony/Twig or a Laravel app already using TwigBridge. For Blade-native Laravel, the pragmatic pattern is a scoped Twig environment dedicated to emails, registered via a service provider and pointed at resources/views/emails. Do not convert application views; keep Blade for web and Twig+Inky for email only. This contains the dual-engine cost to one bounded surface.
Migration path (phased, measurable at each gate).
twig/twig ^3.x and twig/inky-extra ^3.26 to composer.json; register a singleton Twig environment with filesystem loader, template cache, and InkyExtension; create resources/views/emails/ and a base InkyMailable/renderer service that centralizes escaping and CSS inlining (premailer-style).Compatibility considerations.
^3.26 or later to inherit the CVE-2026-46637 XSS fix; document the pin rationale in the repo.Sequencing principle. Prove the rendering pipeline with one template before proving the authoring workflow across the team. The technical integration is cheap; the team-behavior change is the expensive part, and it should be sequenced last.
Maintenance. The package lives under the twigphp organization and shows an active cadence (v3.26.0 shipped a CVE fix). That is a genuine positive for a TPM weighing bus-factor risk. However, low stars and zero dependents mean we should treat it as "maintained, not widely battle-tested" and budget internal ownership accordingly: assign a named maintainer, track upstream releases, and patch within a defined window (e.g., 14 days for security fixes). The dependency surface is small (Twig + Inky), which keeps upgrade risk contained.
Support. No vendor SLA and no commercial backing. Support is community/upstream-issue-driven. Operationally this means: we own first-line diagnosis, we need a documented escalation path to upstream, and we should keep the Inky compilation step isolated enough that a fallback to raw HTML templates is possible without a rewrite.
Scaling. Server-side rendering is CPU-cheap and scales horizontally with the existing web/queue tier. At 10K–100K+ emails/month the cost is negligible; the real scale lever is compiled-template caching and queue-based rendering so peak sends don't block request threads. No new infrastructure is required, which keeps the scaling story simple to explain to stakeholders.
Failure modes to design against.
auto_reload/cache-clear behavior in CI.Ramp-up. Realistic estimate: ~1 sprint for engineering to stand up the scoped Twig environment and pilot, plus ongoing 1–2 sprints of template migration for a typical transactional set. Developers need modest upskilling (Inky component syntax + Twig conditionals — both lightweight for PHP devs). Designers need a short Inky constraint briefing so expectations on dark mode/AMP are set before, not after, build.
TPM recommendation and metrics. Run a 2-month pilot on three transactional flows with a go/no-go gate. Track: (1) dev hours per template vs. baseline, (2) email rendering failure/support-ticket rate, (3) time-to-iterate on a template change, and (4) zero security regressions from the escaping discipline. Success on those four justifies broader rollout; failure on rendering fidelity or security posture is a clean stop-loss, given the contained blast radius of a scoped email-only integration.
How can I help you explore Laravel packages today?