Exemplo n.º 1
0
 /**
  * Sends the confirmation email to a user, after activating.
  * @param  string $code
  * @return void
  */
 public function attemptActivation($code)
 {
     $result = parent::attemptActivation($code);
     if ($result === false) {
         return false;
     }
     if ($mailTemplate = UserSettings::get('welcome_template')) {
         Mail::sendTo($this, $mailTemplate, ['name' => $this->name, 'email' => $this->email]);
     }
     Event::fire('rainlab.user.activate', [$this]);
     return true;
 }
Exemplo n.º 2
0
 /**
  * Sends the confirmation email to a user, after activating
  * @param  string $code
  * @return void
  */
 public function attemptActivation($code)
 {
     $result = parent::attemptActivation($code);
     if ($result === false) {
         return false;
     }
     if (!($mailTemplate = UserSettings::get('welcome_template'))) {
         return;
     }
     $data = ['name' => $this->name, 'email' => $this->email];
     Mail::send($mailTemplate, $data, function ($message) {
         $message->to($this->email, $this->name);
     });
 }