mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 14:14:36 -04:00
Merge pull request #4959 from turbo124/v5-develop
Fixes for newer postmark driver
This commit is contained in:
commit
ced794b33a
@ -3,8 +3,10 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Helpers\Mail\GmailTransportManager;
|
||||
use Coconuts\Mail\PostmarkTransport;
|
||||
use Illuminate\Mail\MailServiceProvider as MailProvider;
|
||||
use Illuminate\Mail\TransportManager;
|
||||
use GuzzleHttp\Client as HttpClient;
|
||||
|
||||
class MailServiceProvider extends MailProvider
|
||||
{
|
||||
@ -24,7 +26,18 @@ class MailServiceProvider extends MailProvider
|
||||
$this->app->bind('mailer', function ($app) {
|
||||
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
|
||||
{
|
||||
return new HttpClient($config);
|
||||
}
|
||||
}
|
||||
|
||||
|
30
config/postmark.php
Normal file
30
config/postmark.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Postmark credentials
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may provide your Postmark server API token.
|
||||
|
|
||||
*/
|
||||
|
||||
'secret' => env('POSTMARK_SECRET'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Guzzle options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Under the hood we use Guzzle to make API calls to Postmark.
|
||||
| Here you may provide any request options for Guzzle.
|
||||
|
|
||||
*/
|
||||
|
||||
'guzzle' => [
|
||||
'timeout' => 10,
|
||||
'connect_timeout' => 10,
|
||||
],
|
||||
];
|
@ -36,9 +36,6 @@ return [
|
||||
'gmail' => [
|
||||
'token' => '',
|
||||
],
|
||||
'postmark' => [
|
||||
'token' => env('POSTMARK_API_TOKEN', ''),
|
||||
],
|
||||
'stripe' => [
|
||||
'model' => App\Models\User::class,
|
||||
'key' => env('STRIPE_KEY'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user