refactor: 邮件正文为 HTML 更改换行符为 br

This commit is contained in:
Argo Zhang 2020-02-24 17:00:28 +08:00
parent e2a216919d
commit 735acfb0d1
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
1 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ namespace Bootstrap.Client.Extensions
var rowData = new StringBuilder(); var rowData = new StringBuilder();
foreach (var row in data.GetProperty("Data").EnumerateObject()) foreach (var row in data.GetProperty("Data").EnumerateObject())
{ {
rowData.AppendFormat(trTemplate, row.Name, row.Value.GetRawText().Replace("\\r\\n", "<br>").Replace("\\n", "<br>")); rowData.AppendFormat(trTemplate, row.Name, row.Value.GetRawText());
} }
sb.Append(string.Format(itemTemplate, cate[itemName], data.GetProperty("Duration").GetString(), state[data.GetProperty("Status").GetRawText()], rowData.ToString())); sb.Append(string.Format(itemTemplate, cate[itemName], data.GetProperty("Duration").GetString(), state[data.GetProperty("Status").GetRawText()], rowData.ToString()));
} }
@ -209,7 +209,7 @@ namespace Bootstrap.Client.Extensions
} }
// 合并消息 // 合并消息
content.AppendLine(msg.Message); content.AppendLine(msg.Message.Replace("\\r\\n", "<br>").Replace("\\n", "<br>"));
} }
if (sender != null && mail != null) if (sender != null && mail != null)
{ {