diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index 665d2dc4f..f821528da 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -706,8 +706,8 @@ namespace IRaCIS.Core.Application.Service var userTypeEnumList = emailConfigInfo.EmailNoticeUserTypeList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList(); - var emailList = await _userRoleRepository.Where(t => userTypeEnumList.Contains(t.UserTypeEnum) && - (isHaveTrialId ? t.UserRoleTrials.Any(t => t.TrialId == feedBack.TrialId) : true)).Select(t => new { t.IdentityUser.EMail, t.UserTypeEnum, t.IdentityUser.FullName }).ToListAsync(); + var emailList = await _userRoleRepository.Where(t => userTypeEnumList.Contains(t.UserTypeEnum) && t.IsUserRoleDisabled == false && t.IdentityUser.Status == UserStateEnum.Enable && + (isHaveTrialId ? t.IdentityUser.UserTrialList.Any(t => t.TrialId == feedBack.TrialId) : true)).Select(t => new { t.IdentityUser.EMail, t.UserTypeEnum, t.IdentityUser.FullName }).ToListAsync(); foreach (var email in emailList)