예제 #1
0
        public void SendAndSaveQuestionAboutAdvert(AdvertContactEmailViewModel model)
        {
            var msg   = _parseEmailService.QuestionAboutAdvert(model);
            var email = _smtpManager.SendEmail(msg);

            var message = Mapper.Map <Message>(model);

            message.Body = email.Body;

            _saveEmailService.SaveEmail(message);
        }
예제 #2
0
        public ActionResult Show(AdvertContactEmailViewModel advertContactEmail, int id)
        {
            var model = _readAdvertService.GetAdvertById(id);

            if (ModelState.IsValid)
            {
                advertContactEmail.AdvertId = id;
                _emailRepository.SendAndSaveQuestionAboutAdvert(advertContactEmail);
                return(View(model));
            }
            return(View(model));
        }
예제 #3
0
        public EmailMessage QuestionAboutAdvert(AdvertContactEmailViewModel model)
        {
            var template = _templateRepository.QuestionAboutAdvert();
            var body     = Engine.Razor.RunCompile(template, "QuestionAboutAdvert",
                                                   typeof(AdvertContactEmailViewModel), model);

            var message = new EmailMessage()
            {
                Body    = body,
                From    = model.Email,
                Subject = "Pytanie dotyczące oferty"
            };

            return(message);
        }