public static void AddUser(RegisterModel model) { string confirmationToken = WebSecurity.CreateUserAndAccount(model.Email, model.Password, new { FirstName = model.FirstName, LastName = model.LastName, About = model.About }, true); var user = model; BodyEmail.BodySend(user, confirmationToken); }
public static void AddUser(RegisterModel model) { WebSecurity.CreateUserAndAccount(model.Email, model.Password, new { FirstName = model.FirstName, LastName = model.LastName, About = model.About }); WebSecurity.Login(model.Email, model.Password); //BodyEmail.BodySend(user, confirmationToken); }
public static void BodySend(RegisterModel model, string confirmationToken) { var uri = new Uri("http://" + System.Web.HttpContext.Current.Request.Url.Authority + "/Account/RegisterConfirmation/" + confirmationToken); string body = "<h4>" + "Your login:"******"<h4>" + "Your password:"******".</div> <div>" + "To activate your account please click on the link:" + "<a href=\"" + uri + "\">" + "Press here" + "</a>" + "<div></h4>"; new SendEmail(model.Email,body); }
public ActionResult Register(RegisterModel model, string[] selectedInterests) { if (ModelState.IsValid) { try { CreativesRepository.AddUser(model); return RedirectToAction("Index","Home"); } catch (MembershipCreateUserException e) { ModelState.AddModelError("", ErrorCodeToString(e.StatusCode)); } } return View(model); }