新增自定义显示TG邮件消息内容

This commit is contained in:
eoao
2025-10-23 00:22:45 +08:00
parent 57638aa8e1
commit aded699314
10 changed files with 118 additions and 61 deletions

View File

@@ -1,7 +1,31 @@
export default function emailMsgTemplate(email) {
return `<b>${email.subject}</b>
export default function emailMsgTemplate(email, tgMsgTo, tgMsgFrom) {
let template = `<b>${email.subject}</b>`
if (tgMsgFrom === 'only-name') {
template += `
发件人:${email.name}`
}
if (tgMsgFrom === 'show') {
template += `
发件人:${email.name} &lt;${email.sendEmail}&gt;`
}
if(tgMsgTo === 'show' && tgMsgFrom === 'hide') {
template += `
发件人:${email.name} &lt;${email.sendEmail}&gt;
收件人:\u200B${email.toEmail}`
return template
}
if(tgMsgTo === 'show') {
template += `
收件人:\u200B${email.toEmail}`
}
return template;
}