コード例 #1
0
        public static void SendAutomationEmailToAllUsersWithExpiringOfAnnualCheckUp(FilterService filterService, MailService mailService)
        {
            List <string> emailsForAnnualCheckUp = filterService.GetMailsForCarsAnnualCheckUpToday().ToList();

            mailService.SendEmail(ApplicationConstants.SubjectExpiringAnnualCheckUp, ApplicationConstants.ContentExpiringAnnualCheckUp, emailsForAnnualCheckUp);

            List <Car> cars = filterService.FilterExpiringAnnualCheckUpToday().ToList();

            foreach (var car in cars)
            {
                car.IsEmailSendedForAnnual = true;
            }

            filterService.SaveChanges();

            Console.WriteLine(ApplicationConstants.SuccessOfAutomationSendingOnEmailsForAnnualCheckUp);
        }