public static ConfigurationModel Initialize(ProfileBase profile)
        {
            ConfigurationModel model = new ConfigurationModel();
            model.PhoneNumber = (string)profile.GetPropertyValue("PhoneNumber");

            model.ReplyToMailbox = (bool)profile.GetPropertyValue("ReplyToMailbox");
            model.SmtpServerName = (string)profile.GetPropertyValue("SmtpServerName");
            model.SmtpServerPort = (int?)profile.GetPropertyValue("SmtpServerPort");
            model.SmtpUserName = (string)profile.GetPropertyValue("SmtpUserName");
            model.SmtpPassword = (string)profile.GetPropertyValue("SmtpPassword");
            model.UseSmtpSsl = (bool)profile.GetPropertyValue("UseSmtpSsl");

            model.AccountSid = (string)profile.GetPropertyValue("AccountSid");
            model.AuthToken = (string)profile.GetPropertyValue("AuthToken");

            return model;
        }
        public ActionResult Configure(ConfigurationModel model)
        {
            if (ModelState.IsValid)
            {
                Profile.SetPropertyValue("PhoneNumber", model.PhoneNumber);

                Profile.SetPropertyValue("ReplyToMailbox", model.ReplyToMailbox);
                Profile.SetPropertyValue("SmtpServerName", model.SmtpServerName);
                Profile.SetPropertyValue("SmtpServerPort", model.SmtpServerPort);
                Profile.SetPropertyValue("SmtpUserName", model.SmtpUserName);
                Profile.SetPropertyValue("SmtpPassword", model.SmtpPassword);
                Profile.SetPropertyValue("UseSmtpSsl", model.UseSmtpSsl);

                Profile.SetPropertyValue("AccountSid", model.AccountSid);
                Profile.SetPropertyValue("AuthToken", model.AuthToken);

                Profile.Save();

                return RedirectToAction("Index", "Home");
            }

            // If we got this far, something failed, redisplay form
            return View(model);
        }