public ActionResult Ragam()
        {
            using (TextReader tw = new StreamReader(Routes.WelcomeFile))
            {
                var mail = HtmlComposer.Link("Ragam Promotion Page(NITCAA)", "http://nitcalumni.com/home/ragam");

                mail += HtmlComposer.Div(" ");//("Ragam Offical Webiste", "http://www.ragam.org.in/2014/");
                mail += HtmlComposer.Link("Ragam Official Website", "http://www.ragam.org.in/2014/");
                mail += string.Format("<a href='http://nitcalumni.com/home/ragam'><img src={0} alt='Ragam-2004 Invitation'/></a>", Routes.ImageUrl("invi.jpg"));
                mail += HtmlComposer.Div(" ");//("Ragam Offical Webiste", "http://www.ragam.org.in/2014/");

                var users = _db.Users.Where(u => u.Email == "*****@*****.**" || u.Email == "*****@*****.**" || u.Email == "*****@*****.**").ToList();
                //var users = _db.Users.Where(u => u.AccountStatus != UserRegisterStatus.Suspended).ToList().Skip(6000).Take(1000).ToList();//.Where(u => u.Email == "*****@*****.**" || u.Email == "*****@*****.**" || u.Email == "*****@*****.**").ToList();
                var cnt    = 1;
                var maxCnt = users.Count;
                foreach (var user in users)
                {
                    MailSrv.SendMailAsync(user, mail, "Ragam'14 Invitation for NITC Alumni", (s) => { if (!s)
                                                                                                      {
                                                                                                          Debug.WriteLine(s);
                                                                                                      }
                                          });
                    Thread.Sleep(900);
                    Debug.WriteLine(cnt++ + "/" + maxCnt);
                }
                return(View("AutoWelcome", users.Count));
            }
        }
        public ActionResult AutoWelcome()
        {
            using (TextReader tw = new StreamReader(Routes.WelcomeFile))
            {
                var mail = tw.ReadToEnd();
                //var users = _db.Users.Where(u => u.Email == "*****@*****.**" || u.Email == "*****@*****.**" || u.Email == "*****@*****.**").ToList();
                var users = _db.Users.Where(u => u.AccountStatus != UserRegisterStatus.Suspended)
                            .ToList()
                            .Skip(6000)
                            .Take(1000).ToList();
                var cnt    = 1;
                var maxCnt = users.Count;
                foreach (var user in users)
                {
                    MailSrv.SendMailAsync(user, mail, "An Appeal to Alumni to be a part of RAGAM 2014", (s) => { if (!s)
                                                                                                                 {
                                                                                                                     Debug.WriteLine(s);
                                                                                                                 }
                                          });
                    Thread.Sleep(800);
                    Debug.WriteLine(cnt++ + "/" + maxCnt);
                }

                return(View(users.Count));
            }
        }
Exemplo n.º 3
0
        public JsonResult Remind(int id)
        {
            var task = _db.ActivityTask.Find(id);
            var user = _db.Users.Find(task.UserId);

            MailSrv.SendMail(user, task.ReminderMail(), "NITCAA | Task Reminder");
            return(Json(new { }, JsonRequestBehavior.AllowGet));
        }