Skip to content

Commit

Permalink
only register id domain if a value was set
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid committed Feb 16, 2018
1 parent 02e7537 commit 5e4b2c5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Illuminate/Mail/MailServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,16 @@ public function registerSwiftMailer()
{
$this->registerSwiftTransport();

Swift_DependencyContainer::getInstance()
->register('mime.idgenerator.idright')
->asValue($this->app->make('config')->get('mail.domain', 'swift.generated'));

// Once we have the transporter registered, we will register the actual Swift
// mailer instance, passing in the transport instances, which allows us to
// override this transporter instances during app start-up if necessary.
$this->app->singleton('swift.mailer', function ($app) {
if ($mailDomain = $app->make('config')->get('mail.domain')) {
Swift_DependencyContainer::getInstance()
->register('mime.idgenerator.idright')
->asValue($mailDomain);
}

return new Swift_Mailer($app['swift.transport']->driver());
});
}
Expand Down

0 comments on commit 5e4b2c5

Please sign in to comment.