示例#1
0
 /**
  * Send the password reminder e-mail.
  *
  * @param  \Illuminate\Contracts\Auth\CanResetPassword  $user
  * @param  string  $token
  * @param  \Closure|null  $callback
  *
  * @return \Orchestra\Contracts\Notification\Receipt
  */
 public function emailResetLink(RemindableContract $user, $token, Closure $callback = null)
 {
     // We will use the reminder view that was given to the broker to display the
     // password reminder e-mail. We'll pass a "token" variable into the views
     // so that it may be displayed for an user to click for password reset.
     $data = ['user' => $user instanceof Arrayable ? $user->toArray() : $user, 'token' => $token];
     $message = Message::create($this->emailView, $data);
     return $this->mailer->send($user, $message, $callback);
 }
示例#2
0
 /**
  * Notify user.
  *
  * @param  \Orchestra\Contracts\Notification\Recipient  $recipient
  * @param  \Illuminate\Database\Eloquent\Model  $user
  * @param  array  $changes
  * @param  array  $config
  *
  * @return bool
  */
 public function notify(Recipient $recipient, Model $user, array $changes, array $config = [])
 {
     if (!$this->mailer instanceof Notification) {
         throw new RuntimeException("Mailer need to be an instance of Orchestra\\Contracts\\Notification\\Notification.");
     }
     if (!!$this->unguarded || empty($changes)) {
         return false;
     }
     $data = ['user' => $user instanceof Arrayable ? $user->toArray() : $user, 'changes' => $changes];
     $message = Message::create($config['email'], $data);
     return $this->mailer->send($recipient, $message);
 }