token = $token; $this->user = $user; } /** * Get the notification's delivery channels. * * @param mixed $notifiable * * @return array */ public function via($notifiable) { return ['mail']; } /** * Get the mail representation of the notification. * * @param mixed $notifiable * * @return \Illuminate\Notifications\Messages\MailMessage */ public function toMail($notifiable) { $message = (new MailMessage()) ->greeting('Hello ' . $this->user->name_first . '!') ->line('You are receiving this email because an account has been created for you on ' . config('app.name') . '.') ->line('Username: ' . $this->user->username) ->line('Email: ' . $this->user->email); if (!is_null($this->token)) { return $message->action('Setup Your Account', url('/auth/password/reset/' . $this->token . '?email=' . urlencode($this->user->email))); } return $message; } }