修复TG一些邮件解析为空和格式优化

This commit is contained in:
eoao
2026-02-08 08:02:01 +08:00
parent 216f7272d8
commit dafb8dda01
4 changed files with 27 additions and 10 deletions

View File

@@ -7,26 +7,26 @@ export default function emailMsgTemplate(email, tgMsgTo, tgMsgFrom, tgMsgText) {
if (tgMsgFrom === 'only-name') {
template += `
发件人${email.name}`
From\u200B${email.name}`
}
if (tgMsgFrom === 'show') {
template += `
发件人${email.name} <${email.sendEmail}>`
From\u200B${email.name} <${email.sendEmail}>`
}
if(tgMsgTo === 'show' && tgMsgFrom === 'hide') {
template += `
收件人\u200B${email.toEmail}`
To\u200B${email.toEmail}`
} else if(tgMsgTo === 'show') {
template += `
收件人\u200B${email.toEmail}`
To\u200B${email.toEmail}`
}
const text = (email.text || emailUtils.htmlToText(email.content))
const text = (emailUtils.formatText(email.text) || emailUtils.htmlToText(email.content))
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');