diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN/Abp/Notifications/Emailing/EmailingNotificationPublishProvider.cs b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN/Abp/Notifications/Emailing/EmailingNotificationPublishProvider.cs index 1ecbbf5bb..01ba8ae8f 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN/Abp/Notifications/Emailing/EmailingNotificationPublishProvider.cs +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN/Abp/Notifications/Emailing/EmailingNotificationPublishProvider.cs @@ -26,7 +26,23 @@ public class EmailingNotificationPublishProvider : NotificationPublishProvider { var userIds = identifiers.Select(x => x.UserId).ToList(); var userList = await UserRepository.GetListByIdListAsync(userIds, cancellationToken: cancellationToken); - var emailAddress = userList.Where(x => x.EmailConfirmed).Select(x => x.Email).Distinct().JoinAsString(","); + + var emailAddress = userList + .Where(x => x.EmailConfirmed) + .Select(x => + { + var userEmail = x.Email; + if (!x.Name.IsNullOrWhiteSpace()) + { + // "admin" + return $"\"{x.Name}\"<{userEmail}>"; + } + + return $"\"{x.UserName}\"<{userEmail}>"; + }) + .Distinct() + .JoinAsString(","); + if (emailAddress.IsNullOrWhiteSpace()) {