public IActionResult Index([FromForm] NewsletterEmail newsletter)
        {
            if (ModelState.IsValid)
            {
                _repositoryNewsletter.Register(newsletter);

                TempData["MSG_S_Newsletter"] = "PRONTO! Agora você irá receber nossas promoções diárias, fique ligado!";

                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(View());
            }
        }
예제 #2
0
        public IActionResult Index([FromForm] NewsletterMail newsletter)
        {
            if (ModelState.IsValid)
            {
                _nRepo.Register(newsletter);

                TempData["NEWS_E"] = "E";

                _mSender.SendNewsletter(newsletter);

                return(RedirectToAction(nameof(Index)));
            }
            else
            {
                return(View());
            }
        }