邮件根据接收人工作语言,动态设置邮件模板

This commit is contained in:
2026-05-13 11:05:22 +08:00
parent 030aa36f94
commit fdb124b12e
7 changed files with 403 additions and 350 deletions
@@ -173,23 +173,16 @@ namespace IRaCIS.Core.Application.Services
if (newUserTypeIds.Any()&& newUserTypeIds.Count()>0)
{
// 发送邮件给新增的角色
Console.WriteLine("开始 发送系统文档更新邮件给新增角色");
Console.WriteLine(string.Join(",", newUserTypeIds));
Log.Logger.Warning("开始 发送系统文档更新邮件给新增角色");
Log.Logger.Warning(string.Join(",", newUserTypeIds));
Task.Run(async () =>
// 只发送给新增的角色
await _mediatorScoped.Publish(new SystemDocumentPublishEvent
{
// 创建独立作用域
using (var scope = serviceScopeFactory.CreateScope())
{
// 从新作用域解析服务
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
// 只发送给新增的角色
await mediator.Publish(new SystemDocumentPublishEvent {
Ids = new List<Guid> { document.Id },
NewUserTypeIds = newUserTypeIds
});
}
Ids = new List<Guid> { document.Id },
NewUserTypeIds = newUserTypeIds
});
}
}
@@ -214,18 +207,10 @@ namespace IRaCIS.Core.Application.Services
IsDeleted = false,
});
Console.WriteLine("开始 发布系统文档");
Log.Logger.Warning("开始 发布系统文档");
await _mediatorScoped.Publish(new SystemDocumentPublishEvent { Ids = inDto.Ids });
Task.Run(async () =>
{
// 创建独立作用域
using (var scope = serviceScopeFactory.CreateScope())
{
// 从新作用域解析服务
var mediator = scope.ServiceProvider.GetRequiredService<IMediator>();
await mediator.Publish(new SystemDocumentPublishEvent { Ids = inDto.Ids });
}
});
return ResponseOutput.Result(true);