mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:29:03 -05:00 
			
		
		
		
	Merge pull request #6053 from turbo124/v5-develop
Fixes for mail providers
This commit is contained in:
		
						commit
						969a2946e5
					
				@ -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;
 | 
			
		||||
        // });
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -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'        
 | 
			
		||||
        ];
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user