public ActionResult HandleForgottenPassword(ForgottenPasswordViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return PartialView("ForgottenPassword", model);
            }

            //Find the member with the email address
            var findMember = Member.GetMemberFromEmail(model.EmailAddress);

            if (findMember != null)
            {
                //We found the member with that email

                //Set expiry date to
                DateTime expiryTime = DateTime.Now.AddMinutes(15);

                //Lets update resetGUID property
                findMember.getProperty("resetGUID").Value = expiryTime.ToString("ddMMyyyyHHmmssFFFF");

                //Save the member with the up[dated property value
                findMember.Save();

                //Send user an email to reset password with GUID in it
                EmailHelper email = new EmailHelper();
                email.SendResetPasswordEmail(findMember.Email, expiryTime.ToString("ddMMyyyyHHmmssFFFF"));
            }
            else
            {
                ModelState.AddModelError("ForgottenPasswordForm.", "No member found");
                return PartialView("ForgottenPassword", model);
            }

            return PartialView("ForgottenPassword", model);
        }
        public ActionResult HandleRegister(RegisterViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return PartialView("Register", model);
            }

            //Member Type
            MemberType umbJobMemberType = MemberType.GetByAlias("Member");

            //Umbraco Admin User (The Umbraco back office username who will create the member via the API)
            User umbUser = new User("Admin");

            //Model valid let's create the member
            try
            {
                Member createMember = Member.MakeNew(model.Name, model.EmailAddress, model.EmailAddress, umbJobMemberType, umbUser);

                //Set password on the newly created member
                createMember.Password = model.Password;

                //Set the verified email to false
                createMember.getProperty("hasVerifiedEmail").Value = false;

                //Set the profile URL to be the member ID, so they have a unqie profile ID, until they go to set it
                createMember.getProperty("profileURL").Value = createMember.Id;

                //Save the changes
                createMember.Save();
            }
            catch (Exception ex)
            {
                //EG: Duplicate email address - already exists
                throw;
            }

            //Create temporary GUID
            var tempGUID = Guid.NewGuid();

            //Fetch our new member we created by their email
            var updateMember = Member.GetMemberFromEmail(model.EmailAddress);

            //Just to be sure...
            if (updateMember != null)
            {
                //Set the verification email GUID value on the member
                updateMember.getProperty("emailVerifyGUID").Value = tempGUID.ToString();

                //Set the Joined Date label on the member
                updateMember.getProperty("joinedDate").Value = DateTime.Now.ToString("dd/MM/yyyy @ HH:mm:ss");

                //Save changes
                updateMember.Save();
            }

            //Send out verification email, with GUID in it
            EmailHelper email = new EmailHelper();
            email.SendVerifyEmail(model.EmailAddress, tempGUID.ToString());

            //Return the view...
            return PartialView("Register", new RegisterViewModel());
        }