public HttpResponseMessage SendConfirmCode(SendConfirmCodeQuery query) { var codeVM = service.SendConfirmCode(query); if (codeVM.Messages.Count == 0) { HttpContext.Current.Session.Add("ConfirmCode", codeVM.Code); } codeVM.Code = ""; return(Request.CreateResponse(HttpStatusCode.OK, codeVM)); }
public ConfirmCodeViewModel SendConfirmCode(SendConfirmCodeQuery query) { ConfirmCodeViewModel vm = new ConfirmCodeViewModel(); if (!validator.UserExists(query.UserName, vm)) { string code = System.IO.Path.GetRandomFileName().Replace(".", "").Substring(0, 8); vm.Code = code; EmailHandler emailHandler = new EmailHandler(true); emailHandler.Send(new List <string> { query.Email }, "Cherries - User Confirmation", GetConfirmationCodeMail(code, query.UserName)); } return(vm); }
public ConfirmCodeViewModel SendConfirmCode(SendConfirmCodeQuery query) { ConfirmCodeViewModel code = userBL.SendConfirmCode(query); return(code); }