diff --git a/app/Providers/MailServiceProvider.php b/app/Providers/MailServiceProvider.php index 8efd5f7e38f5..efe8a15d1f31 100644 --- a/app/Providers/MailServiceProvider.php +++ b/app/Providers/MailServiceProvider.php @@ -28,16 +28,17 @@ class MailServiceProvider extends MailProvider public function boot() { - + $this->app->afterResolving('mail.manager', function (GmailTransportManager $mailManager) { + $mailManager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class)); + return $mailManager; + }); } protected function registerIlluminateMailer() { $this->app->singleton('mail.manager', function($app) { - $manager = new GmailTransportManager($app); - // $manager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class)); - return $manager; + return new GmailTransportManager($app); }); $this->app->bind('mailer', function ($app) { @@ -52,29 +53,6 @@ class MailServiceProvider extends MailProvider ); }); - - $this->app->extend('mail.manager', function(GmailTransportManager $manager) { - - $manager->extend('cocopostmark', function() { - - return new PostmarkTransport( - $this->guzzle(config('postmark.guzzle', [])), - config('postmark.secret') - ); - - // $manager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class)); - }); - - return $manager; - - }); - - app('mail.manager')->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class)); - - // $this->app->afterResolving('mail.manager', function (GmailTransportManager $mailManager) { - // $mailManager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class)); - // return $mailManager; - // }); }