/**
  * Register the application services.
  */
 public function register()
 {
     parent::register();
     $this->app->singleton('mailer', function ($app) {
         $this->registerSwiftMailer();
         // Once we have create the mailer instance, we will set a container instance
         // on the mailer. This allows us to resolve mailer classes via containers
         // for maximum testability on said classes instead of passing Closures.
         $mailer = new Utils\Mailer($app['view'], $app['swift.mailer'], $app['events']);
         $this->setMailerDependencies($mailer, $app);
         // If a "from" address is set, we will set it on the mailer so that all mail
         // messages sent by the applications will utilize the same "from" address
         // on each one, which makes the developer's life a lot more convenient.
         $from = $app->config['mail.from'];
         if (is_array($from) && isset($from['address'])) {
             $mailer->alwaysFrom($from['address'], $from['name']);
         }
         $to = $app->config['mail.to'];
         if (is_array($to) && isset($to['address'])) {
             $mailer->alwaysTo($to['address'], $to['name']);
         }
         // Here we will determine if the mailer should be in "pretend" mode for this
         // environment, which will simply write out e-mail to the logs instead of
         // sending it over the web, which is useful for local dev environments.
         $pretend = $app->config->get('mail.pretend', false);
         $mailer->pretend($pretend);
         return $mailer;
     });
 }
 /**
  * {@inheritDoc}
  */
 protected function registerSwiftTransport($config)
 {
     if ($config['driver'] == 'postmark') {
         $this->registerPostmarkTransport($config);
     } else {
         parent::registerSwiftTransport($config);
     }
 }
 public function registerSwiftMailer()
 {
     if ($this->app['config']->get('mail.driver') == 'bliep') {
         $this->registerBliepMailer();
     } else {
         parent::registerSwiftMailer();
     }
 }
 public function registerSwiftMailer()
 {
     if ($this->app['config']->get('mail.driver') == 'emergency') {
         $this->registerEmergencyMailer();
     } else {
         parent::registerSwiftMailer();
     }
 }
 /**
  * Register the Swift Mailer instance.
  *
  * @return void
  */
 function registerSwiftMailer()
 {
     if ($this->app['config']['mail.driver'] == 'preview') {
         $this->registerPreviewSwiftMailer();
     } else {
         parent::registerSwiftMailer();
     }
 }
 /**
  * Register the Swift Mailer instance.
  *
  * @return void
  */
 public function registerSwiftMailer()
 {
     if ($this->app['config']['mail.driver'] == 'mailman') {
         $this->registerMailmanSwiftMailer();
         $this->registerMailmanLogger();
     } else {
         parent::registerSwiftMailer();
     }
 }
 /**
  * Register the Swift Transport instance.
  *
  * @return void
  */
 protected function registerSwiftTransport()
 {
     if ($this->app->isRunningOnGae()) {
         $this->app['swift.transport'] = $this->app->share(function ($app) {
             return new GaeTransportManager($app);
         });
     } else {
         parent::registerSwiftTransport();
     }
 }
 /**
  * Register the Swift Mailer instance.
  */
 public function registerSwiftMailer()
 {
     if ($this->app['config']['mail.driver'] != 'debug') {
         parent::registerSwiftMailer();
         return;
     }
     $this->app['swift.mailer'] = $this->app->share(function ($app) {
         return new Swift_Mailer(new DebugTransport($app->make(MailDebugManager::class)));
     });
 }
 public function register()
 {
     $config_path = __DIR__ . '/../../config/desmart-laravel-mailer.php';
     $this->publishes([$config_path => config_path('desmart-laravel-mailer.php')], 'config');
     $this->mergeConfigFrom($config_path, 'desmart-laravel-mailer');
     if (true === $this->app['config']->get('desmart-laravel-mailer.enabled')) {
         $this->registerMailer();
     } else {
         parent::register();
     }
 }
 public function register()
 {
     parent::register();
     $this->app->register(SendgridTransportServiceProvider::class);
 }
 public function provides()
 {
     return array_merge(parent::provides(), ['tms.client', 'tms.email']);
 }