Exemple #1
0
 /**
  * Register the mailer.
  *
  * @return void
  */
 protected function register()
 {
     if (!$this->app->bound('view')) {
         $this->app['view'] = new ViewFactory();
     }
     $this->registerSwiftMailer();
     $this->mailer = new Mailer($this->app['view'], $this->app['swift.mailer'], $this->app['events']);
     $this->setMailerDependencies();
     $from = $this->app['config']['mail.from'];
     if (is_array($from) && isset($from['address'])) {
         $this->mailer->alwaysFrom($from['address'], $from['name']);
     }
     $to = $this->app['config']['mail.to'];
     if (is_array($to) && isset($to['address'])) {
         $this->mailer->alwaysTo($to['address'], $to['name']);
     }
 }