This commit is contained in:
Zakharov_Rostislav 2024-05-22 15:07:37 +04:00
parent 922f3bcec2
commit 3c2e1713d6

View File

@ -18,12 +18,14 @@ namespace BlacksmithWorkshopBusinessLogic.MailWorker
protected string _popHost = string.Empty;
protected int _popPort;
private readonly IMessageInfoLogic _messageInfoLogic;
private readonly IClientLogic _clientLogic;
private readonly ILogger _logger;
public AbstractMailWorker(ILogger<AbstractMailWorker> logger,
IMessageInfoLogic messageInfoLogic)
IMessageInfoLogic messageInfoLogic, IClientLogic clientLogic)
{
_logger = logger;
_messageInfoLogic = messageInfoLogic;
_clientLogic = clientLogic;
}
public void MailConfig(MailConfigBindingModel config)
{
@ -73,6 +75,7 @@ namespace BlacksmithWorkshopBusinessLogic.MailWorker
_logger.LogDebug("Check Mail: {Count} new mails", list.Count);
foreach (var mail in list)
{
mail.ClientId = _clientLogic.ReadElement(new () { Email = mail.SenderName })?.Id;
_messageInfoLogic.Create(mail);
}
}