From 06a496aa5f5b1b155f3813ca800a5e41b9f166c8 Mon Sep 17 00:00:00 2001 From: bekodeg Date: Sun, 16 Jun 2024 19:49:43 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=87=D1=82=D0=BE=D0=B1=D1=8B=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B0=D0=BB=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SushiBar/SushiBar/App.config | 4 +-- .../BusinessLogics/OrderLogic.cs | 26 ++++++++++++------- SushiBar/SushiBarRestApi/appsettings.json | 4 +-- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/SushiBar/SushiBar/App.config b/SushiBar/SushiBar/App.config index 5358022..d70523f 100644 --- a/SushiBar/SushiBar/App.config +++ b/SushiBar/SushiBar/App.config @@ -2,10 +2,10 @@ - + - + \ No newline at end of file diff --git a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs index 71147c3..c724cbd 100644 --- a/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/SushiBar/SushiBarBusinessLogic/BusinessLogics/OrderLogic.cs @@ -156,18 +156,26 @@ namespace SushiBarBusinessLogic.BusinessLogics } private bool SendOrderStatusMail(int clientId, string subject, string text) { - var client = _clientLogic.ReadElement(new() { Id = clientId }); - if (client == null) + try + { + var client = _clientLogic.ReadElement(new() { Id = clientId }); + if (client == null) + { + return false; + } + _mailWorker.MailSendAsync(new() + { + MailAddress = client.Email, + Subject = subject, + Text = text + }); + return true; + } + catch (Exception ex) { return false; } - _mailWorker.MailSendAsync(new() - { - MailAddress = client.Email, - Subject = subject, - Text = text - }); - return true; + } } } diff --git a/SushiBar/SushiBarRestApi/appsettings.json b/SushiBar/SushiBarRestApi/appsettings.json index eca666a..51e8ab6 100644 --- a/SushiBar/SushiBarRestApi/appsettings.json +++ b/SushiBar/SushiBarRestApi/appsettings.json @@ -9,12 +9,12 @@ "MailConfigBindingModel": { "SmtpClientHost": "smtp.yandex.ru", - "SmtpClientPort": 465, + "SmtpClientPort": 587, "PopHost": "pop.yandex.com", "PopPort": 995, - "MailLogin": "tester.b.moio@ya.ru", + "MailLogin": "tester.b.moio@yandex.ru", "MailPassword": "pyzzqswchjevecec" } }