Example #1
0
        private void SendReminders()
        {
            bool todoRemindersExisting = true;

            while (todoRemindersExisting)
            {
                var reminder = ReminderRepository.GetNextTimeHasComeReminder();
                if (reminder != null)
                {
                    try
                    {
                        //send reminder
                        this.MessageService.SendReminder(reminder);
                        //increase next reminding date for this reminder
                        ReminderRepository.IncreaseNextRemindingDate(reminder.ID);
                    }
                    catch (Exception ex)
                    {
                        Logger.LogError(ex);
                    }
                }
                //All reminders have been processed, exit loop
                else
                {
                    todoRemindersExisting = false;
                }
            }
        }