mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-11 04:44:36 -04:00
Adjust initialization of mail service provider
This commit is contained in:
parent
ec471283ba
commit
c90fe87388
@ -16,6 +16,16 @@ class MailServiceProvider extends MailProvider
|
|||||||
$this->registerIlluminateMailer();
|
$this->registerIlluminateMailer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
$this->app['mail.manager']->extend('postmark', function () {
|
||||||
|
return new PostmarkTransport(
|
||||||
|
$this->guzzle(config('postmark.guzzle', [])),
|
||||||
|
config('postmark.secret', config('services.postmark.secret'))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected function registerIlluminateMailer()
|
protected function registerIlluminateMailer()
|
||||||
{
|
{
|
||||||
// $this->app->singleton('mail.manager', function($app) {
|
// $this->app->singleton('mail.manager', function($app) {
|
||||||
@ -30,17 +40,18 @@ class MailServiceProvider extends MailProvider
|
|||||||
return $app->make('mail.manager')->mailer();
|
return $app->make('mail.manager')->mailer();
|
||||||
});
|
});
|
||||||
|
|
||||||
$this->app['mail.manager']->extend('postmark', function () {
|
|
||||||
return new PostmarkTransport(
|
|
||||||
$this->guzzle(config('postmark.guzzle', [])),
|
|
||||||
config('postmark.secret', config('services.postmark.secret'))
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function guzzle(array $config): HttpClient
|
protected function guzzle(array $config): HttpClient
|
||||||
{
|
{
|
||||||
return new HttpClient($config);
|
return new HttpClient($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function provides()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'mail.manager',
|
||||||
|
'mailer' ];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user