mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 07:57:33 -05:00 
			
		
		
		
	Fixes for newer postmark driver
This commit is contained in:
		
							parent
							
								
									7abb352965
								
							
						
					
					
						commit
						55a0d596e0
					
				@ -3,8 +3,10 @@
 | 
				
			|||||||
namespace App\Providers;
 | 
					namespace App\Providers;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use App\Helpers\Mail\GmailTransportManager;
 | 
					use App\Helpers\Mail\GmailTransportManager;
 | 
				
			||||||
 | 
					use Coconuts\Mail\PostmarkTransport;
 | 
				
			||||||
use Illuminate\Mail\MailServiceProvider as MailProvider;
 | 
					use Illuminate\Mail\MailServiceProvider as MailProvider;
 | 
				
			||||||
use Illuminate\Mail\TransportManager;
 | 
					use Illuminate\Mail\TransportManager;
 | 
				
			||||||
 | 
					use GuzzleHttp\Client as HttpClient;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class MailServiceProvider extends MailProvider
 | 
					class MailServiceProvider extends MailProvider
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@ -24,7 +26,18 @@ class MailServiceProvider extends MailProvider
 | 
				
			|||||||
        $this->app->bind('mailer', function ($app) {
 | 
					        $this->app->bind('mailer', function ($app) {
 | 
				
			||||||
            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
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        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' => [
 | 
					    'gmail' => [
 | 
				
			||||||
        'token' => '',
 | 
					        'token' => '',
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    'postmark' => [
 | 
					 | 
				
			||||||
        'token' => env('POSTMARK_API_TOKEN', ''),
 | 
					 | 
				
			||||||
    ],
 | 
					 | 
				
			||||||
    'stripe' => [
 | 
					    'stripe' => [
 | 
				
			||||||
        'model'  => App\Models\User::class,
 | 
					        'model'  => App\Models\User::class,
 | 
				
			||||||
        'key'    => env('STRIPE_KEY'),
 | 
					        'key'    => env('STRIPE_KEY'),
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user