From bf5ac566b657a0ec2848d4e095086212e0f90782 Mon Sep 17 00:00:00 2001
From: yiling
Date: Mon, 28 Sep 2026 13:37:16 +0800
Subject: [PATCH] refactor(notification): simplify email wording and remove
redundant team references
---
packages/core/src/notification/email.test.ts | 14 ++++++++---
packages/core/src/notification/email.ts | 25 +++++++++----------
.../src/notification/notification-job.test.ts | 4 +--
3 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/packages/core/src/notification/email.test.ts b/packages/core/src/notification/email.test.ts
index 7f29d2ba..86a1de60 100644
--- a/packages/core/src/notification/email.test.ts
+++ b/packages/core/src/notification/email.test.ts
@@ -544,7 +544,15 @@ describe('EmailService', () => {
],
})
- expect(rendered.subject).toBe('[Shumai] 2 new notifications in Designers')
+ expect(rendered.subject).toBe('[Shumai] 2 new notifications')
+ expect(rendered.html).toContain('You have 2 new updates:')
+ expect(rendered.html).not.toContain('in Designers')
+ expect(rendered.html).toContain('Open Shumai')
+ expect(rendered.html).not.toContain('Open Designers')
+ expect(rendered.html).not.toContain('Team: Designers')
+ expect(rendered.text).toContain('You have 2 new update(s):')
+ expect(rendered.text).toContain('Open Shumai:')
+ expect(rendered.text).not.toContain('Team: Designers')
expect(rendered.html).toContain('img1.png')
expect(rendered.html).toContain('img2.png')
// img1 has thumbnail, img2 does not
@@ -576,7 +584,7 @@ describe('EmailService', () => {
items,
})
- expect(rendered.subject).toBe('[Shumai] 5 new notifications in Designers')
+ expect(rendered.subject).toBe('[Shumai] 5 new notifications')
expect(rendered.html).toContain('Alice uploaded 5 assets to Website Redesign')
// Thumbnails must be omitted for collapsed groups (> 3)
expect(rendered.html).not.toContain('https://example.com/thumb_')
@@ -621,7 +629,7 @@ describe('EmailService', () => {
items: [...commentItems, uploadItem],
})
- expect(rendered.subject).toBe('[Shumai] 5 new notifications in Designers')
+ expect(rendered.subject).toBe('[Shumai] 5 new notifications')
// Collapsed comment group
expect(rendered.html).toContain('UserB left 4 comments in Project Alpha')
// Detailed upload item with thumbnail
diff --git a/packages/core/src/notification/email.ts b/packages/core/src/notification/email.ts
index b91359f2..f9c5d004 100644
--- a/packages/core/src/notification/email.ts
+++ b/packages/core/src/notification/email.ts
@@ -323,7 +323,7 @@ Sent from Shumai at ${baseUrl}
actionText = 'View Task'
} else if (ctx.teamId) {
actionUrl = `${baseUrl}/teams/${ctx.teamId}`
- actionText = 'Open Team'
+ actionText = 'Open Shumai'
}
let subject = '[Shumai] Notification'
@@ -496,7 +496,7 @@ Sent from Shumai at ${baseUrl}
${escapeHtml(actionText)}
-
You have ${ctx.items.length} new update${ctx.items.length > 1 ? 's' : ''} in ${escapeHtml(ctx.teamName)}:
+
You have ${ctx.items.length} new update${ctx.items.length > 1 ? 's' : ''}:
${htmlRows.join('\n')}