From 0f37933631045c3428df64f8ae3ce9236316781a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Jan 2024 10:06:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(notifications):=20=E5=8F=91=E9=80=81?= =?UTF-8?q?=E9=82=AE=E4=BB=B6=E9=80=9A=E7=9F=A5=E6=97=B6=E9=9C=80=E8=A6=81?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2markdown=E6=A0=BC=E5=BC=8F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aspnet-core/Directory.Build.props | 1 + .../LINGYUN.Abp.Notifications.Emailing.csproj | 1 + .../Emailing/EmailingNotificationPublishProvider.cs | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/aspnet-core/Directory.Build.props b/aspnet-core/Directory.Build.props index 973f9f31d..34c342542 100644 --- a/aspnet-core/Directory.Build.props +++ b/aspnet-core/Directory.Build.props @@ -36,6 +36,7 @@ 2.0.1 6.5.0 8.2.0 + 0.34.0 8.0.* 8.0.0 2.6.1 diff --git a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN.Abp.Notifications.Emailing.csproj b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN.Abp.Notifications.Emailing.csproj index 3a9d50536..032f735dc 100644 --- a/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN.Abp.Notifications.Emailing.csproj +++ b/aspnet-core/modules/realtime-notifications/LINGYUN.Abp.Notifications.Emailing/LINGYUN.Abp.Notifications.Emailing.csproj @@ -10,6 +10,7 @@ + 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 3c12a7233..574475263 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 @@ -1,5 +1,6 @@ using LINGYUN.Abp.Identity; using LINGYUN.Abp.RealTime.Localization; +using Markdig; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -59,6 +60,11 @@ public class EmailingNotificationPublishProvider : NotificationPublishProvider { var title = notification.Data.TryGetData("title").ToString(); var message = notification.Data.TryGetData("message").ToString(); + // markdown进行处理 + if (notification.ContentType == NotificationContentType.Markdown) + { + message = Markdown.ToHtml(message); + } await EmailSender.SendAsync(emailAddress, title, message); } @@ -92,6 +98,12 @@ public class EmailingNotificationPublishProvider : NotificationPublishProvider } } + // markdown进行处理 + if (notification.ContentType == NotificationContentType.Markdown) + { + message = Markdown.ToHtml(message); + } + await EmailSender.SendAsync(emailAddress, title, message); } }