diff --git a/AutomobilePlant/AbstractAutoBusinessLogic/BusinessLogics/OrderLogic.cs b/AutomobilePlant/AbstractAutoBusinessLogic/BusinessLogics/OrderLogic.cs index db5a00d..2781273 100644 --- a/AutomobilePlant/AbstractAutoBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/AutomobilePlant/AbstractAutoBusinessLogic/BusinessLogics/OrderLogic.cs @@ -51,8 +51,8 @@ namespace AutomobilePlantBusinessLogic.BusinessLogics _mailKitWorker.MailSendAsync(new MailSendInfoBindingModel { MailAddress = (_clientStorage.GetElement(new ClientSearchModel { Id = newOrder.ClientId})).Email, - Subject = $"Заказ номер {model.Id}", - Text = "Ваш заказ успешно принят" + Subject = $"Заказ номер", + Text = $"Ваш заказ успешно принят. Машина: {model.CarName} в количестве: {model.Count} выйдет на сумму: {model.Sum}" }); return true; } diff --git a/AutomobilePlant/AbstractAutoBusinessLogic/MailWorker/MailKitWorker.cs b/AutomobilePlant/AbstractAutoBusinessLogic/MailWorker/MailKitWorker.cs index 951a136..f77bd88 100644 --- a/AutomobilePlant/AbstractAutoBusinessLogic/MailWorker/MailKitWorker.cs +++ b/AutomobilePlant/AbstractAutoBusinessLogic/MailWorker/MailKitWorker.cs @@ -7,12 +7,15 @@ using Microsoft.Extensions.Logging; using System.Net; using System.Net.Mail; using System.Text; +using AutomobilePlantContracts.StoragesContracts; +using AutomobilePlantContracts.SearchModel; namespace AutomobilePlantBusinessLogic.MailWorker { public class MailKitWorker : AbstractMailWorker { - public MailKitWorker(ILogger logger, IMessageInfoLogic messageInfoLogic) : base(logger, messageInfoLogic) { } + private readonly IClientStorage _clientStorage; + public MailKitWorker(ILogger logger, IMessageInfoLogic messageInfoLogic, IClientStorage clientStorage) : base(logger, messageInfoLogic) { _clientStorage = clientStorage; } protected override async Task SendMailAsync(MailSendInfoBindingModel info) { @@ -58,11 +61,12 @@ namespace AutomobilePlantBusinessLogic.MailWorker list.Add(new MessageInfoBindingModel { DateDelivery = DateTime.SpecifyKind(message.Date.DateTime, DateTimeKind.Utc), + ClientId = _clientStorage.GetElement(new ClientSearchModel { Email = mail.Address }).Id, MessageId = message.MessageId, SenderName = mail.Address, Subject = message.Subject, Body = message.TextBody - }); + }); ; } } } diff --git a/AutomobilePlant/AutoPlantClientApp/Controllers/HomeController.cs b/AutomobilePlant/AutoPlantClientApp/Controllers/HomeController.cs index 4366ab0..df03f46 100644 --- a/AutomobilePlant/AutoPlantClientApp/Controllers/HomeController.cs +++ b/AutomobilePlant/AutoPlantClientApp/Controllers/HomeController.cs @@ -154,7 +154,7 @@ namespace AutoPlantClientApp.Controllers { return Redirect("~/Home/Enter"); } - return View(APIClient.GetRequest>($"api/client/getmessages?clientId={APIClient.Client.Id}")); + return View(APIClient.GetRequest>($"api/client/getmessages?ClientId={APIClient.Client.Id}")); } } } \ No newline at end of file