public function passwordInstructions($id)
    {
        $this->loadModel('User.Users');
        $user = $this->Users->get($id, ['fields' => ['id', 'name', 'email']]);

        if ($user) {
            NotificationManager::passwordRequest($user)->send();
            $this->Flash->success(__d('user', 'Instructions we successfully sent to {0}', $user->name));
        } else {
            $this->Flash->danger(__d('user', 'User was not found.'));
        }

        $this->title(__d('user', 'Recovery Instructions'));
        $this->redirect($this->referer());
    }
public function passwordInstructions($id)
    {
        $this->loadModel('User.Users');
        $user = $this->Users->get($id, ['fields' => ['id', 'name', 'email']]);

        if ($user) {
            NotificationManager::passwordRequest($user)->send();
            $this->Flash->success(__d('user', 'Instructions we successfully sent to {0}', $user->name));
        } else {
            $this->Flash->danger(__d('user', 'User was not found.'));
        }

        $this->title(__d('user', 'Recovery Instructions'));
        $this->redirect($this->referer());
    }
public function passwordInstructions ( $ id ) { $ this -> loadModel ( 'User.Users' ) ; $ user = $ this -> Users -> get ( $ id , [ 'fields' => [ 'id' , 'name' , 'email' ] ] ) ; if ( $ user ) { NotificationManager :: passwordRequest ( $ user ) -> send ( ) ; $ this -> Flash -> success ( __d ( 'user' , 'Instructions we successfully sent to {0}' , $ user -> name ) ) ; } else { $ this -> Flash -> danger ( __d ( 'user' , 'User was not found.' ) ) ; } $ this -> title ( __d ( 'user' , 'Recovery Instructions' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
Sends password recovery instructions to the given user.

@param int $id User's ID
@return void Redirects to previous page
Sends password recovery instructions to the given user .