예제 #1
0
        private void popOutButton_Click(object sender, EventArgs e)
        {
            Discard();

            NewEmailForm form = new NewEmailForm((RadDocument)mailRichTextEditor.Document.CreateDeepCopy(), toTextBoxControl.Text, ccTextBoxControl.Text, subjectTextBoxControl.Text);

            form.Show();
        }
예제 #2
0
        public async Task <IActionResult> ChangeEmail(NewEmailForm newEmailForm)
        {
            if (!bool.Parse(_settingsKeeper.GetSetting("EnableEmailRecovery").Value))
            {
                return(RedirectToAction("Index"));
            }

            if (ModelState.IsValid)
            {
                var user = await _userManager.GetUserAsync(User);

                var code = await _userManager.GenerateChangeEmailTokenAsync(user, newEmailForm.NewEmail);

                var callbackUrl = $"{_settingsKeeper.GetSetting("SiteUrl").Value}{Url.Action("Confirm", "SignIn", new {userId = user.Id, code})}";
                await _emailSender.SendEmailAsync(user.Email, "Email change requested", $"Click on the following link to change your email. Link: {callbackUrl}");
            }
            else
            {
                TempData["Error"] = true;
            }

            return(View("NewEmail"));
        }
예제 #3
0
        private void newEmailButton_Click(object sender, EventArgs e)
        {
            NewEmailForm form = new NewEmailForm();

            form.Show();
        }