From 079c11a7e35817ba2297ad0cb1bde51b483d3cc3 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Thu, 18 Dec 2025 15:47:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/EmailLogService.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Common/EmailLogService.cs b/IRaCIS.Core.Application/Service/Common/EmailLogService.cs index 287e7b36e..39f53cb54 100644 --- a/IRaCIS.Core.Application/Service/Common/EmailLogService.cs +++ b/IRaCIS.Core.Application/Service/Common/EmailLogService.cs @@ -271,7 +271,17 @@ public class EmailLogService(IRepository _emailLogRepository, [HttpPost] public async Task SynchronizationEmail(SynchronizationEmailInDto inDto) { - var maxTime = await _emailLogRepository.MaxAsync(t => t.EmailDate); + + var fromEmail = _systemEmailConfig.FromEmail; + + + if (inDto.TrialId != null) + { + fromEmail= await _trialRepository.Where(x => x.Id == inDto.TrialId.Value).Select(x => x.EmailFromEmail).FirstNotNullAsync(); + + } + + var maxTime = await _emailLogRepository.Where(x=>x.SenderAddress== fromEmail).MaxAsync(t => t.EmailDate); var startDate = maxTime ?? DateTime.MinValue; List emailList = new List(); List EmailRecipientLogList = new List();