From 441b3b81512e9eca1f92ea44453ed1c69ea2f8f5 Mon Sep 17 00:00:00 2001 From: Zakharov_Rostislav Date: Mon, 27 May 2024 01:58:09 +0400 Subject: [PATCH] fix --- Bank/BankRestApi/Controllers/ReportController.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Bank/BankRestApi/Controllers/ReportController.cs b/Bank/BankRestApi/Controllers/ReportController.cs index 3de5221..f6820ab 100644 --- a/Bank/BankRestApi/Controllers/ReportController.cs +++ b/Bank/BankRestApi/Controllers/ReportController.cs @@ -1,4 +1,5 @@ -using BankContracts.BindingModels; +using BankBusinessLogic.MailWorker; +using BankContracts.BindingModels; using BankContracts.BusinessLogicsContracts; using Microsoft.AspNetCore.Mvc; @@ -10,11 +11,13 @@ namespace BankRestApi.Controllers { private readonly ILogger _logger; private readonly IReportLogic _logic; + private readonly AbstractMailWorker _mailWorker; - public ReportController(ILogger logger, IReportLogic logic) + public ReportController(ILogger logger, IReportLogic logic, AbstractMailWorker mailWorker) { _logger = logger; _logic = logic; + _mailWorker = mailWorker; } [HttpPost] @@ -76,6 +79,12 @@ namespace BankRestApi.Controllers try { _logic.SaveTransfersWithdrawalsToPdfFile(model); + _mailWorker.MailSendAsync(new MailSendInfoBindingModel + { + MailAddress = model.Email!, + Subject = "Отчет по животным", + Text = "Лови" + }); } catch (Exception ex) {