Exemplo n.º 1
0
 public RazorEmailResult WeeklyFavorite(FavoriteTweetViewModel viewModel)
 {
     From = "*****@*****.**";
     To.Add(viewModel.User.Email);
     Subject = "Your favorite tweets!";
     return(Email("FavoriteTweet", viewModel));
 }
Exemplo n.º 2
0
 public RazorEmailResult WeeklyFavorite(FavoriteTweetViewModel viewModel)
 {
     From = "*****@*****.**";
     To.Add(viewModel.User.Email);
     Subject = "Your favorite tweets!";
     return Email("FavoriteTweet", viewModel);
 }
Exemplo n.º 3
0
        public void Execute(IJobExecutionContext context)
        {
            Console.WriteLine("MailerJob.Execute");
            foreach(var user in userRepository.GetAll())
            {
                var tweets = tweetRepository.GetFavoritesForUser(user).Where(t => t.CreatedDate > user.EpochOfTweets);
                var vm = new FavoriteTweetViewModel
                    {
                        Tweets = tweets,
                        User = user
                    };

                mail.WeeklyFavorite(vm).Deliver();

                user.EpochOfTweets = DateTime.MinValue;
                userRepository.Save(user);
            }
        }
Exemplo n.º 4
0
        public void Execute(IJobExecutionContext context)
        {
            Console.WriteLine("MailerJob.Execute");
            foreach (var user in userRepository.GetAll())
            {
                var tweets = tweetRepository.GetFavoritesForUser(user).Where(t => t.CreatedDate > user.EpochOfTweets);
                var vm     = new FavoriteTweetViewModel
                {
                    Tweets = tweets,
                    User   = user
                };

                mail.WeeklyFavorite(vm).Deliver();

                user.EpochOfTweets = DateTime.MinValue;
                userRepository.Save(user);
            }
        }