Weave Code
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

Inky Extra Laravel Package

twig/inky-extra

Twig extension that adds the inky_to_html filter to convert Zurb Inky email templates into standard HTML. Useful for rendering responsive email markup inside Twig-based projects, including Symfony/Twig apps, with minimal setup.

View on GitHub
Deep Wiki
Context7

A Twig extension for the inky email templating engine

Frequently asked questions about Inky Extra
How do I integrate **twig/inky-extra** into an existing Laravel project with Twig?
First, install the package via Composer (`composer require twig/inky-extra`). Then, configure a dedicated Twig environment for emails in `config/services.php` and register a service provider to bind it. Use the `inky_to_html` filter in your Twig templates by extending the environment with the Inky extension.
Can I use **twig/inky-extra** with Laravel’s Mailable classes?
Yes. Override the `build()` method in your Mailable class to render Twig templates with Inky markup. For example, replace `markdown()` with `$this->twig('emails.welcome.inky.twig', ['user' => $this->user])` and ensure your Twig environment includes the Inky extension.
What Laravel versions and Twig versions does **twig/inky-extra** support?
The package requires **Twig 3.x** and works with any Laravel version that supports Twig (Laravel 8+ recommended). Ensure compatibility by checking the package’s dependencies in `composer.json` and verifying your Laravel and Twig versions match the supported ranges.
How do I handle responsive email design with Inky in Laravel?
Inky’s markup inherently supports responsive design via media queries. Use Laravel Mix or Vite to inline critical CSS (e.g., `@media` queries) for compatibility with email clients like Gmail. Test responsiveness using tools like Litmus or Email on Acid.
Does **twig/inky-extra** support reusable email components or partials?
Yes. Organize your Inky templates in `resources/views/emails/` with `.inky.twig` extensions. Use Twig’s `{% include %}` or `{% extends %}` tags to create reusable components, such as headers, footers, or buttons, while keeping your templates DRY.
How do I test Inky templates before sending emails in production?
Render templates locally using `php artisan twig:dump` or a custom helper method. Validate HTML output with Inky’s CLI tools or online validators. Test email rendering in real clients (Gmail, Outlook) using Litmus or Email on Acid to catch rendering issues early.
Will **twig/inky-extra** work with Laravel’s queue system for transactional emails?
Absolutely. Offload email rendering by setting `shouldQueue()` in your Mailable class. The `inky_to_html` filter processes templates server-side, so queued jobs will render Inky markup efficiently without blocking HTTP requests.
Are there alternatives to **twig/inky-extra** for Laravel email templates?
Alternatives include using Blade templates directly with CSS frameworks like MJML or Foundation for Emails, or leveraging Laravel’s built-in `markdown()` method with HTML email libraries like Mailchimp’s Mandrill. However, **twig/inky-extra** uniquely combines Twig’s flexibility with Inky’s concise, component-based syntax.
How do I handle dynamic content and security (e.g., XSS) in Inky templates?
Twig automatically escapes variables by default, mitigating XSS risks. For dynamic content, use Twig’s `{{ variable|raw }}` sparingly and validate inputs. Test edge cases (e.g., HTML/JS in user-provided text) by rendering templates with malicious payloads in a sandboxed environment.
What’s the best way to maintain and update **twig/inky-extra** in a Laravel project?
Monitor updates via Packagist or GitHub releases. Use Composer’s `update` command cautiously, as breaking changes may require Twig or Inky version adjustments. Test updates in a staging environment with your email templates to ensure compatibility before deploying to production.
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.
codraw/entity-migrator
codraw/doctrine-extra
codraw/aws-tool-kit
codraw/validator
codraw/workflow
codraw/open-api
codraw/cron-job
codraw/process
codraw/log
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony