Ejemplo n.º 1
0
        public HttpResponseMessage ForgotPassword(string email)
        {
            _logger.LogInformation("LoginController.ForgotPassword method called!");
            var userDetails = userDetailsDBContext.Userdetails.Where(x => x.Email.Equals(email) &&
                                                                     x.Isactive == true).FirstOrDefault();

            if (userDetails == null)
            {
                return(new HttpResponseMessage(HttpStatusCode.NotFound));
            }
            else
            {
                try
                {
                    //Send Email with Reset-Password Link
                    SendMail.Email(email);
                }
                catch (Exception ex)
                {
                    return(new HttpResponseMessage(HttpStatusCode.NotFound));
                }
                return(new HttpResponseMessage(HttpStatusCode.OK));
            }
        }