Ejemplo n.º 1
0
 public ActionResult Create(Newsletter newsletter)
 {
     if (ModelState.IsValid)
     {
         newsletterService.Insert(newsletter);
         return(RedirectToAction("Index"));
     }
     return(View(newsletter));
 }
Ejemplo n.º 2
0
        public bool Newsletter(string email)
        {
            if (string.IsNullOrEmpty(email))
            {
                return(false);
            }

            _newsletterService.Insert(new Newsletter()
            {
                Email = email, OptIn = true
            });

            return(true);
        }
Ejemplo n.º 3
0
 public ActionResult NewsletterSubscribtion(Newsletter newsletter, string controllerName, string actionName)
 {
     if (ModelState.IsValid)
     {
         var getEmails = newsletterService.GetAll();
         if (getEmails.FirstOrDefault(f => f.Email == newsletter.Email) == null)
         {
             newsletterService.Insert(newsletter);
             return(RedirectToAction(actionName, controllerName));
         }
         TempData["Message"] = "Bu E-Posta adresi sisteme kayıtlıdır.";
     }
     return(Redirect("/" + controllerName + "/" + actionName + "/#mc_embed_signup"));
 }