新增tg和第三方邮件转发
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user