示例#1
0
        public ActionResult SendBetaActivation(Guid id)
        {
            using (var ctx = new OpenGrooves.Data.OpenGroovesEntities())
            {
                var user = ctx.Users.SingleOrDefault(u => u.UserId == id);

                if (user != null)
                {
                    var replacements = new Dictionary <string, string>();
                    var url          = String.Format("http://preview.opengrooves.com/activate/{0}/setupaccount", Core.Helpers.UrlGuidHelper.GetUrlString(user.UserId));
                    replacements.Add("ACTIVATION", url);

                    var template = TemplateBuilder.LoadTemplate(NotificationType.BetaTestActivate, replacements);

                    template.To.Add(user.Email);
                    EmailHelper.SendEmail(template);

                    template.To.Clear();
                    template.To.Add("*****@*****.**");
                    EmailHelper.SendEmail(template);
                }

                return(RedirectToRoute("Default", new { action = "BetaTesters" }));
            }
        }
示例#2
0
        public ActionResult BetaTesters()
        {
            var model = new ConsoleModel();

            using (var ctx = new OpenGrooves.Data.OpenGroovesEntities())
            {
                var users = ctx.Users.Where(u => u.SetupRequired).AsEnumerable().Select(u => new BetaUser
                {
                    ActivationUrl = String.Format("http://preview.opengrooves.com/activate/{0}/setupaccount", Core.Helpers.UrlGuidHelper.GetUrlString(u.UserId)),
                    Username      = u.UserName,
                    Email         = u.Email,
                    Name          = u.RealName,
                    UserId        = u.UserId
                });

                model.BetaUsers = users.ToList();
            }

            return(View(model));
        }