Esempio n. 1
0
 public RazorEmailResult WeeklyFavorite(FavoriteTweetViewModel viewModel)
 {
     From = "*****@*****.**";
     To.Add(viewModel.User.Email);
     Subject = "Your favorite tweets!";
     return(Email("FavoriteTweet", viewModel));
 }
Esempio n. 2
0
 public RazorEmailResult WeeklyFavorite(FavoriteTweetViewModel viewModel)
 {
     From = "*****@*****.**";
     To.Add(viewModel.User.Email);
     Subject = "Your favorite tweets!";
     return Email("FavoriteTweet", viewModel);
 }
Esempio 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);
            }
        }
Esempio 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);
            }
        }