- How do I install laravel-mail-auto-embed in a Laravel app?
- Install it with Composer using composer require eduardokum/laravel-mail-auto-embed. Laravel package auto-discovery registers the service provider, so the happy path requires no manual provider wiring. Publishing the config file is optional if you need to adjust behavior. You do not need to change Blade templates or Mailable sending code.
- Which Laravel and PHP versions does laravel-mail-auto-embed support?
- The package targets Laravel's mail rendering pipeline and modern Symfony Mailer-based Laravel releases. Because it depends on mail internals that change across major versions, verify the composer.json constraints and CI matrix for your exact Laravel and PHP versions before upgrading. Do not assume support for older SwiftMailer-based Laravel versions without checking.
- Does it work with Laravel Markdown mailables?
- Yes, it is designed to compose with Markdown mailables without template changes. The package rewrites image references during mail rendering, so Markdown mail paths can benefit from inline CID embedding like regular HTML mailables. Test one representative Markdown Mailable and inspect the raw MIME output to confirm behavior in your app.
- Does laravel-mail-auto-embed fetch remote images, and is that an SSRF risk?
- The package supports local and remote image sources, but remote fetching should be treated as an SSRF surface. Restrict resolution to trusted hosts or disable remote resolution where possible, and confine local path resolution to an allowed root. Prefer local assets or already-approved CDN URLs for production transactional email.
- Will it double-embed images if my code already calls $message->embed()?
- Automatic HTML rewriting can duplicate embedding when existing code already calls $message->embed() for the same image. Audit current embed usage first, then remove or disable redundant manual embedding for affected mailables. Send a test message and inspect the raw MIME structure to confirm each image appears only once.
- How can I disable auto-embedding for a specific mailable?
- Use the package config or an environment flag as a global kill switch for low-risk rollout and fast rollback. Confirm whether your installed version exposes per-mailable scoping before relying on it. If per-mailable control is not available, disable globally for streams that already embed images or gate the behavior through your own Mailable base class.
- Does it work with queued Mailables and Laravel notifications?
- It is intended to compose with Mailables, Notifications, and queued Mailables because it hooks into mail rendering rather than sending code. Queuing should not change the embedding behavior, but you should still test with your real queue worker and mail driver. Verify the rendered MIME after the job runs, especially if you use Markdown mail or custom Mailer decorators.
- Does inline image embedding increase email size and affect deliverability?
- Yes, converting images to inline CID attachments increases the size of each message and can push it toward provider size limits. Measure the payload delta for a typical transactional email with a logo and a few inline images. Keep images optimized, avoid unnecessary remote fetches, and confirm attachment handling with your actual provider such as SES, Mailgun, Postmark, or SMTP.
- What are alternatives to laravel-mail-auto-embed?
- Alternatives include manually calling $message->embed() in each Mailable, serving absolute CDN image URLs, or building a custom Mailer or Transport decorator. Manual embed calls give precise control but add template and sending-code changes across mailables. The package is most useful when you want inline images without editing every template, and least useful when email must stay tiny or a CDN already serves reliable absolute URLs.
- Is laravel-mail-auto-embed production-ready and actively maintained?
- It has a narrow architectural footprint and a recent release, but it has roughly 171 stars and effectively one maintainer, so bus-factor risk is real. Pin the version in composer.json, watch upstream releases, and budget a review at every Laravel major upgrade because mail internals can shift. Before production rollout, validate it behind a feature flag with one notification stream and confirm the CI and test posture for the exact version you adopt.