fixed email schedule's getEmailsToSend function