public async Task <IActionResult> EditData(string identifier, SendEmailViewModel data)
        {
            var result = await GetRecipeAction(identifier);

            if (result.Error != null)
            {
                return(result.Error);
            }

            if (!ModelState.IsValid)
            {
                var pop3Services = await _externalServiceManager.GetExternalServicesData(new ExternalServicesDataQuery()
                {
                    Type   = new[] { SmtpService.SmtpExternalServiceType },
                    UserId = _userManager.GetUserId(User)
                });


                data.ExternalServices = new SelectList(pop3Services, nameof(ExternalServiceData.Id),
                                                       nameof(ExternalServiceData.Name), data.ExternalServiceId);
                return(View(data));
            }

            var recipeAction = result.Data;

            SetValues(data, recipeAction);

            await _recipeManager.AddOrUpdateRecipeAction(recipeAction);

            return(RedirectToAction("EditRecipe", "Recipes", new
            {
                id = recipeAction.RecipeId,
                statusMessage = "Send Email Action Updated"
            }));
        }
        public ActionResult Send_Email(SendEmailViewModel model, int id)
        {
            //ViewBag.ToEmail = new SelectList(db.Tutors, "Id", "Email", id);
            var tutor      = db.Tutors.Find(id);
            var tutoremail = tutor.Email;
            var userId     = User.Identity.GetUserId();
            var user       = db.AspNetUsers.Find(userId);
            var userEmail  = user.Email;

            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = tutoremail;
                    String subject  = "Message from user: "******"Email has been sent successfully.";

                    ModelState.Clear();

                    return(View());
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
Exemple #3
0
        public ActionResult Send_Email(SendEmailViewModel model)
        {
            if (User.IsInRole("Administrator"))
            {
                if (ModelState.IsValid)
                {
                    try
                    {
                        String toEmail  = model.ToEmail;
                        String subject  = model.Subject;
                        String contents = model.Contents;

                        EmailSender es = new EmailSender();
                        es.Send(toEmail, subject, contents);

                        ViewBag.Result = "Email has been sent.";

                        ModelState.Clear();

                        return(View(new SendEmailViewModel()));
                    }
                    catch
                    {
                        return(View());
                    }
                }

                return(View());
            }
            // redirect logged-in users who are not administrators
            else
            {
                return(Redirect("~/Home"));
            }
        }
        public async Task <IActionResult> EditData(string identifier)
        {
            var result = await GetRecipeAction(identifier);

            if (result.Error != null)
            {
                return(result.Error);
            }

            var smtpServices = await _externalServiceManager.GetExternalServicesData(new ExternalServicesDataQuery()
            {
                Type   = new[] { SmtpService.SmtpExternalServiceType },
                UserId = _userManager.GetUserId(User)
            });

            var vm = new SendEmailViewModel()
            {
                ExternalServices = new SelectList(smtpServices, nameof(ExternalServiceData.Id),
                                                  nameof(ExternalServiceData.Name), result.Data.ExternalServiceId),
            };

            SetValues(result.Data, vm);

            return(View(vm));
        }
        public async Task <ActionResult> SendValidCodeSelf()
        {
            var user  = service.Get(SessionManager.UserID);
            var model = new SendEmailViewModel
            {
                Email          = user.Email,
                SystemMailType = SystemMailType.ConfirmEmail,
                ValidType      = ValidType.ConfirmEmail
            };

            var result = service.SendValidCodeCheck(model);

            if (result.IsSuccess)
            {
                var mailService = new MailService(ApplicationHelper.ClientID);
                var mailContent = new ReplaceMailContent
                {
                    UserName  = result.Data.Name,
                    UserEmail = model.Email
                };
                var mailResult = await mailService.SendEmail(result.Data.ID, mailContent, model.SystemMailType, model.ValidType, fromFn : "SendValidCodeSelf");

                return(Json(mailResult));
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> SendValidCode(SendEmailViewModel model)
        {
            var result = new CiResult <mgt_User>();

            //驗證碼
            if (string.IsNullOrWhiteSpace(model.Captcha) || SessionManager.Captcha != model.Captcha)
            {
                result.Message = SystemMessage.CaptchaError;
            }

            if (string.IsNullOrEmpty(result.Message))
            {
                result = service.SendValidCodeCheck(model);
                if (result.IsSuccess)
                {
                    var mailService = new MailService(ApplicationHelper.ClientID);
                    var mailContent = new ReplaceMailContent
                    {
                        UserName  = result.Data.Name,
                        UserEmail = model.Email
                    };
                    var mailResult = await mailService.SendEmail(result.Data.ID, mailContent, model.SystemMailType, model.ValidType, fromFn : "SendValidCode");

                    return(Json(mailResult));
                }
            }

            return(Json(result));
        }
Exemple #7
0
        public ActionResult Upload_File(SendEmailViewModel model)
        {
            try
            {
                HttpPostedFileBase postedFile = model.Upload;
                String             fileAddress;

                if (postedFile != null)
                {
                    string path = Server.MapPath("~/Uploads/");
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }

                    String fileName = Path.GetFileName(postedFile.FileName);
                    fileAddress = path + fileName;
                    postedFile.SaveAs(fileAddress);
                    ViewBag.Result = "File uploaded successfully.";
                }
                ModelState.Clear();

                return(View(new SendEmailViewModel()));
            }
            catch
            {
                return(View());
            }
        }
Exemple #8
0
        public ActionResult Send_Email(SendEmailViewModel model, HttpPostedFileBase postedFileBase)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = model.ToEmail;
                    String subject  = model.Subject;
                    String contents = model.Contents;
                    //HttpPostedFileBase postedFileBase= model.Upload;

                    EmailSender         es             = new EmailSender();
                    String[]            toEmailArray   = toEmail.Split(';');
                    List <EmailAddress> emailAddresses = new List <EmailAddress>();
                    foreach (String s in toEmailArray)
                    {
                        emailAddresses.Add(new EmailAddress(s, ""));
                    }
                    es.Send(emailAddresses, subject, contents, postedFileBase);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
        public ActionResult Contact(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String fromEmail = model.ToEmail;
                    String subject   = model.Subject;
                    String contents  = model.Contents + "Email of Person: " + fromEmail;

                    EmailSender es = new EmailSender();

                    //.Send("(FromEmail)", "(ToEmail)", subject, contents);
                    es.Send("*****@*****.**", "*****@*****.**", subject, contents);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
Exemple #10
0
        public async Task <IActionResult> BeforeConfirmEmail(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = await _userManager.FindByEmailAsync(model.Email);

                if (user != null && !(await _userManager.IsEmailConfirmedAsync(user)))
                {
                    var result = await SendMessageAsync(user);

                    if (result)
                    {
                        ViewBag.Message = "We sent a message. Please check your email";
                        return(View("Info"));
                    }
                    else
                    {
                        ViewBag.ErrorMessage = "Failed to send message";
                        return(View("Error"));
                    }
                }
                else
                {
                    ViewBag.ErrorTitle = "Email is already confirming";
                    return(View("Error"));
                }
            }
            return(View(model));
        }
        public ActionResult Send_Email(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = model.ToEmail;
                    String subject  = model.Subject;
                    String contents = model.Contents;

                    var attachment = Request.Files["attachment"];

                    String path = Path.Combine(Server.MapPath("~/Content/Attachment/"), attachment.FileName);
                    attachment.SaveAs(path);

                    EmailSender es = new EmailSender();
                    es.SendWithAttachment(toEmail, subject, contents, path, attachment.FileName);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
Exemple #12
0
        public ActionResult Send_Email(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = model.ToEmail;
                    String subject  = model.Subject;
                    String contents = model.Contents;

                    //String path = model.Attachment.ToString();
                    //string fileName = model.Attachment.FileName;

                    String fileName = model.FilePath;
                    string filePath = Server.MapPath("~/" + fileName);

                    EmailSender es = new EmailSender();
                    es.Send(toEmail, subject, contents, filePath, fileName);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
Exemple #13
0
        /// <summary>
        /// 重寄驗證信
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns></returns>
        public async Task <ActionResult> SendConfirmMail(Guid id)
        {
            var result = new CiResult <mgt_User>();
            var user   = service.Get(id);

            //check mail
            var model = new SendEmailViewModel
            {
                Email          = user.Email,
                SystemMailType = SystemMailType.ConfirmEmail
            };

            result = service.SendValidCodeCheck(model);

            //send
            if (result.IsSuccess)
            {
                var mailService = new MailService(SessionManager.Client.ID);
                var mailContent = new ReplaceMailContent
                {
                    UserName  = result.Data.Name,
                    UserEmail = model.Email
                };
                var mailResult = await mailService.SendEmail(result.Data.ID, mailContent, model.SystemMailType, model.ValidType, fromFn : "Admin_SendConfirmMail");

                return(Json(mailResult, JsonRequestBehavior.AllowGet));
            }

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
        public async Task <ActionResult> SendEmail(SendEmailViewModel model)
        {
            try
            {
                var         _email      = "*****@*****.**";                          // here we are adding sender's email
                var         _epass      = ConfigurationManager.AppSettings["EmailPassword"]; //here we'll get our password from web.config
                var         _dispName   = "Vaibhav";                                         //add your display name to show in receiver's mail box
                MailMessage mailMessage = new MailMessage();
                mailMessage.To.Add(model.Email);
                mailMessage.From       = new MailAddress(_email, _dispName);
                mailMessage.Subject    = "Subject";
                mailMessage.Body       = "Message";
                mailMessage.IsBodyHtml = true;   //we are using an html template and we want our msg to be displayed as an
                                                 //html we set our message's IsBodyHtml value to true


                using (SmtpClient smtp = new SmtpClient())
                {
                    smtp.EnableSsl             = true;
                    smtp.Host                  = "smtp.live.com";
                    smtp.Port                  = 587;
                    smtp.UseDefaultCredentials = false;
                    smtp.Credentials           = new NetworkCredential(_email, _epass);
                    smtp.DeliveryMethod        = SmtpDeliveryMethod.Network;
                    smtp.SendCompleted        += (s, e) => { smtp.Dispose(); };
                    await smtp.SendMailAsync(mailMessage);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(RedirectToAction("Index", "Email"));
        }
        public async Task <IActionResult> SendMuliMail([FromBody] SendEmailViewModel sendEmailVm)
        {
            var hasPermission = await _authorizationService.AuthorizeAsync(User, "USER", Operations.Read);

            if (hasPermission.Succeeded == false)
            {
                return(new BadRequestObjectResult(CommonConstants.Forbidden));
            }
            if (ModelState.IsValid)
            {
                try
                {
                    sendEmailVm.ListEmail = _subcribleService.GetAllEmail();
                    var accesToken = Request.Headers["Authorization"];
                    await _senMailService.SendMultiEmail(sendEmailVm.ListEmail, sendEmailVm.Subject, sendEmailVm.Message, accesToken);

                    return(new OkObjectResult(sendEmailVm));
                }
                catch (Exception ex)
                {
                    return(new BadRequestObjectResult(sendEmailVm));
                }
            }
            return(new BadRequestObjectResult(ModelState));
        }
        public ActionResult Send_Email(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = model.ToEmail;
                    String subject  = model.Subject;
                    String contents = model.Contents;

                    EmailSender es = new EmailSender();
                    es.Send(toEmail, subject, contents);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
        private string ValidateModelData(SendEmailViewModel model)
        {
            string message = string.Empty;

            if (string.IsNullOrEmpty(model.To))
            {
                message = "Please enter Email";
                return(message);
            }
            else if (!IsValidMultipleEmail(model.To))
            {
                message = "Email address is not valid in 'To' Email";
                return(message);
            }

            if (!string.IsNullOrEmpty(model.CC) && !IsValidMultipleEmail(model.CC))
            {
                message = "Email address is not valid in 'CC' Email";
                return(message);
            }

            if (!string.IsNullOrEmpty(model.BCC) && !IsValidMultipleEmail(model.BCC))
            {
                message = "Email address is not valid in 'BCC' Email";
                return(message);
            }

            return(message);
        }
        public async Task <List <BooksViewModel> > GetBookList()
        {
            List <BooksViewModel> bookList       = new List <BooksViewModel>();
            SendEmail             newMail        = new SendEmail();
            SendEmailViewModel    emailViewModel = new SendEmailViewModel()
            {
                subject = "Book Submission Deadline Over",
            };

            using (IDbConnection conn = Connection)
            {
                string query = (@" select Books.Id,bookName, AspNetUsers.UserName as 'Name', AspNetUsers.Email as 'Email', anu.userName as 'requestedBy',anu.Id as 'requestedId', anu.Email as 'requestedEmail', issuedOn, returnDate,isAvailable,isTaken, isRequested
                                    from Books 
                                    left join AspNetUsers on Books.issuedBy = AspNetUsers.ID
                                    Left join AspNetUsers anu on Books.requestedBy = anu.ID ");
                conn.Open();
                var results = await conn.QueryAsync <BooksViewModel>(query);

                foreach (var result in results)
                {
                    if (DateTime.Now > result.returnDate)
                    {
                        emailViewModel.requestorName  = result.Name;
                        emailViewModel.requestorEmail = result.Email;
                        emailViewModel.Message        = emailViewModel.requestorName + ", \n The deadline for the book has exceeded. Please return the book on time ";

                        newMail.SendMail(emailViewModel);
                    }
                }

                return(results.ToList());
            }
        }
Exemple #19
0
        public ActionResult Send_Email(SendEmailViewModel model, HttpPostedFileBase postedFile)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = model.ToEmail;
                    String subject  = model.Subject;
                    String contents = model.Contents;

                    List <String> toEmails = toEmail.Split(';').ToList <String>();

                    foreach (String emailaddress in toEmails)
                    {
                        EmailSender es = new EmailSender();
                        es.Send(emailaddress.Trim(), subject, contents, postedFile);
                    }

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
Exemple #20
0
        public ActionResult SendEmail(SendEmailViewModel model, HttpPostedFileBase postedFile)
        {
            TryValidateModel(model);
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail         = model.ToEmail;
                    String toAddRecipients = model.ToAddRecipients;
                    String subject         = model.Subject;
                    String contents        = model.Contents;

                    EmailSender es = new EmailSender();
                    es.Send(toEmail, toAddRecipients, subject, contents, postedFile);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
        public IActionResult SendEmail(SendEmailViewModel model)
        {
            ViewData["AllCategories"] = _categoryRepository.GetAll().ToList();
            if (ModelState.IsValid)
            {
                var message = new MailMessage();
                message.From = new MailAddress("*****@*****.**");
                message.To.Add("*****@*****.**");
                message.Subject = "tin nhắn từ liên hệ";
                message.Body    = String.Format("Tên: {0}\n" +
                                                "Địa chỉ Email: {1}\n" +
                                                "Tiêu đề: {2}\n" +
                                                "Tin nhắn: {3}\n",
                                                model.Name, model.Email, model.Subject, model.Message);
                var SmtpServer = new SmtpClient("smtp.gmail.com");
                SmtpServer.Port                  = 587;
                SmtpServer.DeliveryMethod        = SmtpDeliveryMethod.Network;
                SmtpServer.UseDefaultCredentials = false;
                SmtpServer.Credentials           = new System.Net.NetworkCredential("*****@*****.**", "1234567893bros");
                SmtpServer.EnableSsl             = true;
                SmtpServer.Send(message);

                return(RedirectToAction("Index"));
            }
            return(View(nameof(About), model));
        }
        public void SendMail(SendEmailViewModel email)
        {
            var          fromAddress  = new MailAddress("*****@*****.**", "Biraz Dahal"); // use gmail
            var          toAddress    = new MailAddress(email.requestorEmail, email.requestorName);
            const string fromPassword = "******";                                           // use password
            string       subject      = email.subject;
            string       body         = email.Message;

            var smtp = new SmtpClient
            {
                Host           = "smtp.gmail.com",
                Port           = 587,
                EnableSsl      = true,
                DeliveryMethod = SmtpDeliveryMethod.Network,
                Credentials    = new NetworkCredential(fromAddress.Address, fromPassword),
                Timeout        = 20000
            };

            using (var message = new MailMessage(fromAddress, toAddress)
            {
                Subject = subject,
                Body = body
            })
            {
                smtp.Send(message);
            }
        }
Exemple #23
0
        public IActionResult SendEmail([FromBody] SendEmailViewModel details)
        {
            try
            {
                var emailCsv = details.Email;

                string connectUri = $"activemq:tcp://{_configProvider.GetActiveMqHost()}:{_configProvider.GetActiveMqPort()}";

                var queueConnectedEvent = new AutoResetEvent(false);

                _queueOperator.TryConnect(connectUri, _configProvider.GetActiveMqUser(),
                                          _configProvider.GetActiveMqPassword(), queueConnectedEvent, 10000, 2000);

                if (queueConnectedEvent.WaitOne(10000))
                {
                    var propertyDict = new Dictionary <string, string>
                    {
                        { "email_recipients", emailCsv },
                        { "email_subject", "Forgotten Email" }
                    };
                    _queueOperator.ProduceMessage("Hello there!", propertyDict);

                    _queueOperator.Dispose();
                    return(Ok("Sent"));
                }
            }
            catch (Exception ex)
            {
                _queueOperator.Dispose();
                return(StatusCode(500, "Could not connect to ActiveMQ service." + ex));
            }
            return(StatusCode(500, "Could not connect to ActiveMQ service."));
        }
Exemple #24
0
        public ActionResult Contact(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    string fromEmail = model.FromEmail;
                    string subject   = model.Subject;
                    string contents  = model.Contents;

                    EmailSender es           = new EmailSender();
                    var         toAdminEmail = "*****@*****.**";
                    es.SendAsync(fromEmail, new List <string> {
                        toAdminEmail
                    }, subject, contents);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
        public ActionResult Send_Email(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = model.ToEmail;
                    String subject  = model.Subject;
                    String contents = model.Contents;
                    //String contents = model.Upload.FileName;

                    HttpPostedFileBase file = model.Upload;

                    var bookings = db.Bookings.ToList();


                    EmailSender es = new EmailSender();
                    es.Send(toEmail, subject, contents, file);

                    ViewBag.Result = "Email has been send successfully !!!!";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            return(View());
        }
Exemple #26
0
        public ActionResult Send_Email(SendEmailViewModel model)
        {
            var emailList = model.To.Split(';');

            foreach (string toEmail in emailList)
            {
                using (MailMessage mm = new MailMessage(model.Email, toEmail))
                {
                    mm.Subject = model.Subject;
                    mm.Body    = model.Body;

                    if (model.Attachment.ContentLength > 0)
                    {
                        string fileName = Path.GetFileName(model.Attachment.FileName);
                        mm.Attachments.Add(new Attachment(model.Attachment.InputStream, fileName));
                    }

                    mm.IsBodyHtml = false;

                    using (SmtpClient smtp = new SmtpClient())
                    {
                        smtp.Host      = "smtp.gmail.com";
                        smtp.EnableSsl = true;
                        NetworkCredential NetworkCred = new NetworkCredential(model.Email, model.Password);
                        smtp.UseDefaultCredentials = true;
                        smtp.Credentials           = NetworkCred;
                        smtp.Port = 587;
                        smtp.Send(mm);
                        ViewBag.Message = "Email sent.";
                    }
                }
            }
            return(View());
        }
        public ActionResult Send_Email(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = model.ToEmail;
                    String subject  = model.Subject;
                    String contents = model.Contents;

                    EmailSender es = new EmailSender();
                    es.Send(toEmail, subject, contents);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }

            //if (model.Upload != null && model.Upload.ContentLength > 0)
            //{
            //    message.Attachments.Add(new attachment(model.Upload.InputStream,
            //    System.IO.Path.GetFileName(model.Upload.FileName)));
            // }

            return(View());
        }
Exemple #28
0
        public ActionResult SendEmail(SendEmailViewModel model, HttpPostedFileBase Attachment)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    String toEmail  = model.ToEmail;
                    String subject  = model.Subject;
                    String contents = model.Contents;
                    model.filename = Attachment.FileName;
                    String serverPath = Server.MapPath("~/Uploadfile/");
                    model.Path = serverPath + model.filename;
                    Attachment.SaveAs(model.Path);
                    SendEmail es = new SendEmail();
                    es.Send(toEmail, subject, contents, model.filename, model.Path);

                    ViewBag.Result = "Email has been send.";

                    ModelState.Clear();

                    return(View(new SendEmailViewModel()));
                }
                catch
                {
                    return(View());
                }
            }
            return(View());
        }
        public async Task<IActionResult> ReconfirmRegistrationOrForgotPassword(SendEmailViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = await _userManager.FindByEmailAsync(model.Email);

                if (user != null)
                {
                    if (!await _userManager.IsEmailConfirmedAsync(user))
                    {
                        var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
                        var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code }, HttpContext.Request.Scheme);
                        await _emailService.SendEmailAsync(model.Email, "Atut - Potwierdź utworzenie konta", $"Potwierdź utworzenie konta w systemie Atut klikając w link: <a href='{callbackUrl}'>link</a>");
                    }
                    else
                    {
                        var code = await _userManager.GeneratePasswordResetTokenAsync(user);
                        var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code }, HttpContext.Request.Scheme);
                        await _emailService.SendEmailAsync(model.Email, "Atut - Odzyskiwanie hasła", "Aby zresetować hasło w systemi Atut klinij w link i postępuj zgodnie z instrukcjami: <a href=\"" + callbackUrl + "\">link</a>");
                    }
                }

                _notificationManager.Add(NotificationType.Information, "Na skrzynkę e-mailową wysłana została wiadomość w celu rozwiązania problemu. Kliknij link w wiadomości.");
                return RedirectToAction(nameof(Login), "Account");
            }

            return View("SendEmail", model);
        }
Exemple #30
0
        public ActionResult DeleteConfirmed(string id)
        {
            SendEmailViewModel sendEmailViewModel = db.SendEmailViewModels.Find(id);

            db.SendEmailViewModels.Remove(sendEmailViewModel);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }