public void SendEmailToUser(EmailMassageModel emailMassageModel)
        {
            MailSender mailSender = new MailSender();
            mailSender.Send(emailMassageModel.Email, emailMassageModel.Subject, emailMassageModel.Message);


        }
 public void SendEmailToUser(EmailMassageModel emailMassageModel)
 {
     this.readerHistoryFacade.SendEmailToUser(emailMassageModel);
 }
        public EmailMassageModel GetMassageModelByReaderId(int readerId)
        {

            EmailMassageModel emailMassageModel = new EmailMassageModel();
            ReaderHistoryMapper historyMapper = new ReaderHistoryMapper();
            List<ReaderHistoryBusinessModel> readerHistoryBusiness = new List<ReaderHistoryBusinessModel>();

            List<ReaderHistory> readerHistory = this.uow.ReadersHistories.GetAll().Where(r => r.Reader.ReaderId == readerId && r.FinishDate < DateTime.Now && r.ReturnDate == null)
                .Select(r => r).ToList();

            for (int i = 0; i < readerHistory.Count; i++)
            {
                readerHistoryBusiness.Add(historyMapper.Map(readerHistory[i]));
            }

            string books = null;
            foreach (var book in readerHistoryBusiness)
            {
                books += book.InventoryBusiness.Item.Name + ", ";
            }

            emailMassageModel.FirsName = readerHistoryBusiness.First().ReaderBusiness.FirstName;
            emailMassageModel.LastName = readerHistoryBusiness.First().ReaderBusiness.LastName;
            emailMassageModel.Email = readerHistoryBusiness.First().ReaderBusiness.EMail;
            emailMassageModel.Subject = "Owing Book";
            emailMassageModel.Message = "Dear student: " + emailMassageModel.FirsName + " " + emailMassageModel.LastName + ": " +
                "you owe the books: " + books + "Please back them to the library";

            return emailMassageModel;
        }