Merge pull request 'SmtpException при отправке уведомлений не должна отправляться клиенту' (#231) from fix/#28432054-edit-responsibility-persons into dev

Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/231
This commit is contained in:
Никита Фролов 2024-03-01 13:35:55 +05:00
commit 7867001610

View File

@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net.Mail;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using AsbCloudApp.Data; using AsbCloudApp.Data;
@ -60,7 +61,15 @@ public class NotificationService
var notificationTransportService = GetTransportService(request.IdTransportType); var notificationTransportService = GetTransportService(request.IdTransportType);
await notificationTransportService.SendAsync(notification, cancellationToken); //todo Добавить задачу в WorkToSendEmail
try
{
await notificationTransportService.SendAsync(notification, cancellationToken);
}
catch (SmtpException ex)
{
Console.WriteLine(ex.Message);
}
notification.SentDate = DateTime.UtcNow; notification.SentDate = DateTime.UtcNow;
await notificationRepository.UpdateAsync(notification, cancellationToken); await notificationRepository.UpdateAsync(notification, cancellationToken);