mercredi 30 décembre 2015

Laravel - How to check reset password email sent successfully to the user?

I have following function postEmail in my PasswordController.php and calling when user trying to reset password.

/**
     * Send a reset link to the given user.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function postEmail(Request $request)
    {
        //echo Input::get('ID'); die;
        $this->validate($request, ['ID' => 'required|email']);

        // Pass data to reset password mail template
        view()->composer('emails.password', function($view) {
            $view->with([
                'UserProduct1'   => 'UserProduct1',
                'UserProduct2'   => 'UserProduct2',
            ]);
        });

        $response = Password::sendResetLink($request->only('ID'), function (Message $message) {
            $message->subject($this->getEmailSubject());
        });

        switch ($response) {
            case Password::RESET_LINK_SENT:
                return redirect()->back()->with('status', trans($response));

            case Password::INVALID_USER:
                return redirect()->back()->withErrors(['ID' => trans($response)]);
        }
    }

Is there any way to check, reset email sent or not to the user in laravel.

Any Idea?

Thanks.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1PyHurx
via IFTTT

Aucun commentaire:

Enregistrer un commentaire