Fixes for mail providers

This commit is contained in:
David Bomba 2021-06-17 12:57:47 +10:00
parent 480f1abd9a
commit eb3d3ca858
2 changed files with 12 additions and 10 deletions

View File

@ -33,9 +33,9 @@ class MailCssInlinerServiceProvider extends ServiceProvider
return new CssInlinerPlugin([]);
});
$this->app->afterResolving('mail.manager', function (MailManager $mailManager) {
$mailManager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class));
return $mailManager;
});
// $this->app->afterResolving('mail.manager', function (MailManager $mailManager) {
// $mailManager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class));
// return $mailManager;
// });
}
}

View File

@ -3,10 +3,11 @@
namespace App\Providers;
use App\Helpers\Mail\GmailTransportManager;
use App\Utils\CssInlinerPlugin;
use Coconuts\Mail\PostmarkTransport;
use GuzzleHttp\Client as HttpClient;
use Illuminate\Mail\MailServiceProvider as MailProvider;
use Illuminate\Mail\TransportManager;
use GuzzleHttp\Client as HttpClient;
class MailServiceProvider extends MailProvider
{
@ -27,10 +28,6 @@ class MailServiceProvider extends MailProvider
return new GmailTransportManager($app);
});
// $this->app->bind('mail.manager', function($app) {
// return new GmailTransportManager($app);
// });
$this->app->bind('mailer', function ($app) {
return $app->make('mail.manager')->mailer();
});
@ -42,6 +39,10 @@ class MailServiceProvider extends MailProvider
);
});
$this->app->afterResolving('mail.manager', function (GmailTransportManager $mailManager) {
$mailManager->getSwiftMailer()->registerPlugin($this->app->make(CssInlinerPlugin::class));
return $mailManager;
});
}
protected function guzzle(array $config): HttpClient
@ -57,6 +58,7 @@ class MailServiceProvider extends MailProvider
{
return [
'mail.manager',
'mailer' ];
'mailer'
];
}
}