laravel-mail-css-inliner: Inliner can never find CSS file

I’ve defined my CSS files in my configuration, yet when I do, it always complains about not being able to find css/email.css, for file_get_contents. Which is accurate, no such file exists for that, because it’s not using the full public_path, which IS set in my config:

return [
    'css-files' => [
        public_path('css/email.css')
    ]
];

So not sure what’s going on here, but as it stands it’s straight up not working.

Update: I found that if you’re doing this with config, you shouldn’t also have a link stylesheet in your html, so I removed that, no error - but also - zero styling/inline styles. Just can’t seem to get this library to work as expected.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 21 (1 by maintainers)

Most upvoted comments

Have the same issue - To circumvent I changed my css include to

   <link rel="stylesheet" type="text/css" href="{{ public_path() . mix('css/mail.css') }}">

Still a bug but at least this way it does inline

Hi , Any solution for laravel 9 without vite (mix) ? Thank’s !

@kirkbushell thanks for the workaround, this sounds like a quite logical explanation indeed.
I’ll try to give it a shot this month and come back to let you know if it works, but in the meantime thank you so much for taking the time to give those hints!

Coming back to this, this package just doesn’t seem to work as advertised. I’ve tried every which way to get it working on Laravel 8, but unfortunately it never seems to find the files required.