Skip to content

Add Laravel v7 support #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2020
Merged

Add Laravel v7 support #70

merged 1 commit into from
Apr 4, 2020

Conversation

introwit
Copy link
Contributor

@introwit introwit commented Mar 3, 2020

Please tag a release soon :)

@zupolgec
Copy link
Contributor

zupolgec commented Mar 3, 2020

This is not enough. In Laravel 7 something changed about Mailers.

I managed to have it working changing these lines in LaravelMailCssInlinerServiceProvider.php from this:

$this->app->extend('swift.mailer', function (Swift_Mailer $swiftMailer, $app) {
    $inlinerPlugin = $app->make(CssInlinerPlugin::class);
    $swiftMailer->registerPlugin($inlinerPlugin);
    return $swiftMailer;
});

to:

$this->app->extend('mail.manager', function (MailManager $mailManager) {
    $mailManager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class));
    return $mailManager;
});

But this change should be on a new version branch, compatible only with Laravel 7.

@introwit
Copy link
Contributor Author

introwit commented Mar 4, 2020

@zupolgec nothing has changed with regards to the scope of this package. Only the structure of the config/mail.php file has been changed (upgrade notes) but that is not related to this package in anyway, something else might be broken in your laravel 7 app. @fedeisas can we merge this PR and tag a major release for Laravel 7 please? 🙂

@zupolgec
Copy link
Contributor

zupolgec commented Mar 4, 2020

@introwit did you test it? I did. Brand new Laravel 7 app and it doesn't work.

The initialization of Switft Mailer changed: laravel/framework@53f555a#diff-47a7eab8d5efdc88be216b16d303c993

If you need a fixed package, add these lines at the end of your composer.json file:

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/zupolgec/laravel-mail-css-inliner.git"
    }
]

and add "fedeisas/laravel-mail-css-inliner": "dev-master" in the require section.

@timhaak
Copy link

timhaak commented Mar 11, 2020

@zupolgec possibly create a pull request with your changes as well to make it easier for the maintainer to merge :).

Thanks for working it out what was needed :)

@zupolgec zupolgec mentioned this pull request Mar 12, 2020
@fedeisas fedeisas merged commit e241177 into fedeisas:master Apr 4, 2020
@fedeisas fedeisas mentioned this pull request Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants