新增tg和第三方邮件转发

This commit is contained in:
eoao
2025-06-28 13:35:37 +08:00
parent 010e0451ab
commit 136c0496b8
25 changed files with 948 additions and 457 deletions

View File

@@ -1,15 +1,24 @@
import { parseHTML } from 'linkedom';
const emailUtils = {
getDomain(email) {
if (typeof email !== 'string') return ''
const parts = email.split('@')
return parts.length === 2 ? parts[1] : ''
if (typeof email !== 'string') return '';
const parts = email.split('@');
return parts.length === 2 ? parts[1] : '';
},
getName(email) {
if (typeof email !== 'string') return ''
const parts = email.trim().split('@')
return parts.length === 2 ? parts[0] : ''
}
}
if (typeof email !== 'string') return '';
const parts = email.trim().split('@');
return parts.length === 2 ? parts[0] : '';
},
export default emailUtils
htmlToText(content) {
const { document } = parseHTML(content);
document.querySelectorAll('style, script, title').forEach(el => el.remove());
return document.documentElement.innerText;
}
};
export default emailUtils;