Ejemplo n.º 1
0
        public virtual ActionResult SubscriptionActivation(Guid token, bool active)
        {
            var subscription = _newsLetterSubscriptionService.GetNewsLetterOrderByGuid(token);

            if (subscription == null)
            {
                return(RedirectToRoute("HomePage"));
            }

            if (active)
            {
                subscription.Active = true;
                _newsLetterSubscriptionService.UpdateNewsLetterSubscription(subscription);
            }
            else
            {
                _newsLetterSubscriptionService.DeleteNewsLetterSubscription(subscription);
            }

            var model = _newsletterModelFactory.PrepareSubscriptionActivationModel(active);

            return(View(model));
        }