twig/inky-extra
Twig extension that adds the inky_to_html filter, converting Zurb Inky email templates into HTML. Useful for building responsive email markup within Twig templates in Symfony and other Twig-based apps.
Mailable and Twig ecosystems, enabling backend-driven email templating without frontend dependencies. The inky_to_html filter integrates seamlessly into Laravel’s existing email workflow, reducing complexity for teams already using Twig or Blade.Blade escaping) can complement this further.twig/twig (v3.x), which may necessitate a partial or full adoption of Twig if not already in use. However, Laravel’s Blade and Twig can coexist by scoping Twig to email templates via a dedicated Twig\Environment instance.Mailable classes can be extended to apply the inky_to_html filter dynamically, e.g., via a custom build() method or event listener.inky --check) should validate asset dependencies.{{ user.name }}) can be passed to Inky templates, but escaping must be handled to prevent XSS. Laravel’s htmlspecialchars or Twig’s auto-escaping can mitigate this.Twig\Environment to avoid conflicts. Provide a migration guide for converting Blade to Twig for email-specific use cases.htmlspecialchars).bench() and optimize critical paths.shouldQueue()) to decouple rendering from HTTP requests.twig/inky-extra could become problematic if the package stagnates or Inky’s syntax changes.resources/views/emails/*.inky.twig)? Will a custom FilesystemLoader be needed?{{ user.name }}) interact with Inky’s syntax? Are there edge cases (e.g., nested loops, conditionals) that need testing?Mailable tests) that can be extended to verify Inky output?Mailable classes with Twig + Inky for responsive, dynamic emails. Ideal for transactional emails (e.g., password resets, receipts) and marketing campaigns with personalized content.twig/twig and twig/inky-extra to composer.json.Twig\Environment for emails in a service provider (e.g., EmailServiceProvider).Mailable template with an Inky + Twig template (e.g., resources/views/emails/welcome.inky.twig).php artisan twig:dump and validate output in Email on Acid.InkyMailable class extending Laravel’s Mailable to standardize Inky usage.withInkyFilter() method to apply the inky_to_html filter dynamically.{{ user.name }}, conditionals).mjml/laravel.Twig\Environment instance to avoid conflicts with Blade. Example:
// EmailServiceProvider.php
public function register()
{
$loader = new \Twig\Loader\FilesystemLoader(app_path('Views/emails'));
$twig = new \Twig\Environment($loader);
$twig->addExtension(new \Twig\Extra\Inky\InkyExtension());
app()->singleton('twig.email', fn() => $twig);
}
// mix.js
mix.postCss('resources/css/inky.css',
How can I help you explore Laravel packages today?