Beispiel #1
0
        public ActionResult subscribe(string email)
        {
            IserviceNL spnl = new serviceNL();

            if (spnl.Get(x => x.mailsubs == email) == null)
            {
                Subscribers mnl = new Subscribers();
                mnl.mailsubs = email;
                spnl.Add(mnl);
                spnl.Commit();
            }
            return(RedirectToAction("index"));
        }
Beispiel #2
0
        public ActionResult Newsletter(string obj, string body)
        {
            IServiceMS sms  = new ServiceMS();
            IserviceNL spnl = new serviceNL();

            try
            {
                string mails = spnl.GetAll().SelectMany(a => a.mailsubs.Split(',')).ToString();
                sms.sendMail(mails, obj, body);
            }
            catch (Exception)
            {
                return(RedirectToAction("index"));
            }

            return(RedirectToAction("Index"));
        }