Exemple #1
0
        public IEnumerable <DailyEmail> GetDateEmails(DateTime date)
        {
            var allMessages = _gmailApi.GetAllMessagesAsync().Result;

            foreach (var item in allMessages.Messages)
            {
                var message = _gmailApi.GetMessageAsync(item.Id).Result;

                if (_dailyEmailFactory.GenerateDateEmail(message, date))
                {
                    break;
                }
            }
            return(_dailyEmailFactory.GetEmails());
        }