From b8b1bee0156aafd7b44c3ac57c2fe1af5a8c835c Mon Sep 17 00:00:00 2001 From: eoao Date: Wed, 22 Oct 2025 21:33:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9ETG=E9=82=AE=E4=BB=B6=E6=9F=A5?= =?UTF-8?q?=E7=9C=8BHTML?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mail-vue/src/components/shadow-html/index.vue | 4 +- mail-vue/src/i18n/en.js | 18 +-- mail-vue/src/i18n/zh.js | 3 +- mail-vue/src/views/sys-setting/index.vue | 7 +- mail-worker/src/api/role-api.js | 1 - mail-worker/src/api/telegram-api.js | 8 + mail-worker/src/email/email.js | 44 +----- mail-worker/src/entity/setting.js | 3 +- mail-worker/src/hono/webs.js | 1 + mail-worker/src/init/init.js | 5 +- mail-worker/src/security/security.js | 10 +- mail-worker/src/service/telegram-service.js | 109 ++++++++++++++ mail-worker/src/template/email-html.js | 139 ++++++++++++++++++ mail-worker/src/template/email-msg.js | 7 + mail-worker/src/template/email-text.js | 35 +++++ 15 files changed, 332 insertions(+), 62 deletions(-) create mode 100644 mail-worker/src/api/telegram-api.js create mode 100644 mail-worker/src/service/telegram-service.js create mode 100644 mail-worker/src/template/email-html.js create mode 100644 mail-worker/src/template/email-msg.js create mode 100644 mail-worker/src/template/email-text.js diff --git a/mail-vue/src/components/shadow-html/index.vue b/mail-vue/src/components/shadow-html/index.vue index e929157..74f2cd3 100644 --- a/mail-vue/src/components/shadow-html/index.vue +++ b/mail-vue/src/components/shadow-html/index.vue @@ -36,7 +36,7 @@ function updateContent() { all: initial; width: 100%; height: 100%; - font-family: Inter, -apple-system, BlinkMacSystemFont, + font-family: -apple-system, Inter, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-size: 14px; line-height: 1.5; @@ -119,7 +119,7 @@ watch(() => props.html, () => { width: 100%; height: 100%; overflow: hidden; - font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + font-family: -apple-system, Inter, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; } .content-html { diff --git a/mail-vue/src/i18n/en.js b/mail-vue/src/i18n/en.js index 029f42b..a3efd2b 100644 --- a/mail-vue/src/i18n/en.js +++ b/mail-vue/src/i18n/en.js @@ -137,7 +137,7 @@ const en = { websiteReg: 'Sign Up', loginDomain: 'Sign-In Box Domain', multipleEmail: 'Multiple Accounts', - multipleEmailDesc: 'Enable this feature to allow users to add multiple accounts', + multipleEmailDesc: 'Enable this feature to allow users to add multiple accounts.', customization: 'Customization', websiteTitle: 'Title', loginBoxOpacity: 'Login Box Opacity', @@ -145,7 +145,7 @@ const en = { emailSetting: 'Email', receiveEmail: 'Receive Email', autoRefresh: 'Auto Refresh', - autoRefreshDesc: 'Automatically fetch the latest emails from the server', + autoRefreshDesc: 'Automatically fetch the latest emails from the server.', sendEmail: 'Send Email', resendToken: 'Resend Token', oss: 'Object Storage', @@ -165,7 +165,7 @@ const en = { version: 'Version', community: 'Community', changeTitle: 'Change Title', - addResendTokenDesc: 'Input to add; leave empty to delete', + addResendTokenDesc: 'Input to add; leave empty to delete.', addOsDomain: 'Add Domain', domainDesc: 'Domain', addTurnstileSecret: 'Add turnstile secret', @@ -173,14 +173,14 @@ const en = { tgBotDesc: 'Forward received emails to a Telegram bot', tgBotToken: 'Bot token', toBotTokenDesc: 'Multiple user chat_ids, separated by commas', - otherEmailDesc: 'emails can be forwarded to external email, but must be verified via cloudflare', + otherEmailDesc: 'emails can be forwarded to external email, but must be verified via cloudflare.', otherEmailInputDesc: 'Separate multiple email addresses with commas.', - forwardingRulesDesc: 'Rule-based forwarding only forwards emails received by the specified address', - ruleEmailsInputDesc: 'Separate multiple email addresses with commas', + forwardingRulesDesc: 'Rule-based forwarding only forwards emails received by the specified address.', + ruleEmailsInputDesc: 'Separate multiple email addresses with commas.', resendTokenList: 'Token List', domain: 'Domain', optional: 'Optional', - subjectInputDesc: 'Please enter the email subject', + subjectInputDesc: 'Please enter the email subject.', changeUserName: 'Change Username', sendSeparately: 'Separately', send: 'Send', @@ -295,8 +295,8 @@ const en = { confirmDeletionOfContacts: 'Confirm clearing contacts?', recentContacts: 'Recent contacts', selectContacts: 'Select', - forcePathStyleDesc: 'Some self-hosted object storages require path-style access to be enabled', - kvStorageDesc: 'Replace object storage with KV, and update the access domain to a Worker custom domain', + forcePathStyleDesc: 'Some self-hosted object storages require path-style access to be enabled.', + kvStorageDesc: 'Replace object storage with KV, and update the access domain to a Worker custom domain.', kvStorage: 'KV Storage' } diff --git a/mail-vue/src/i18n/zh.js b/mail-vue/src/i18n/zh.js index 6622b52..e4545e2 100644 --- a/mail-vue/src/i18n/zh.js +++ b/mail-vue/src/i18n/zh.js @@ -298,6 +298,7 @@ const zh = { selectContacts: '选中', forcePathStyleDesc: '路径样式访问,一些自建的对象存储需要打开', kvStorageDesc: '使用KV替代对象存储,访问域名改成worker自定义域', - kvStorage: 'KV存储' + kvStorage: 'KV存储', + customDomainDesc: 'Worker 自定义域' } export default zh diff --git a/mail-vue/src/views/sys-setting/index.vue b/mail-vue/src/views/sys-setting/index.vue index eb214ce..0579975 100644 --- a/mail-vue/src/views/sys-setting/index.vue +++ b/mail-vue/src/views/sys-setting/index.vue @@ -485,6 +485,7 @@ +