From 4a3180ee0403dd5c5aa671a371678b26f5f11a6c Mon Sep 17 00:00:00 2001
From: fengmk2
Date: Tue, 18 Mar 2025 01:00:13 +0000
Subject: [PATCH] feat(server): display date in yyyy-MM-dd format on email
(#10916)
---
packages/backend/server/package.json | 1 +
.../__tests__/__snapshots__/mailer.spec.ts.md | 20 +++++++++---------
.../__snapshots__/mailer.spec.ts.snap | Bin 4260 -> 4251 bytes
.../server/src/mails/components/date.tsx | 11 ++++++++++
.../server/src/mails/components/index.ts | 1 +
.../server/src/mails/teams/delete-in-1m.tsx | 9 ++++----
.../server/src/mails/teams/delete-in-24h.tsx | 7 +++---
.../server/src/mails/teams/expire-soon.tsx | 8 +++----
.../server/src/mails/teams/expired.tsx | 8 +++----
yarn.lock | 1 +
10 files changed, 39 insertions(+), 27 deletions(-)
create mode 100644 packages/backend/server/src/mails/components/date.tsx
diff --git a/packages/backend/server/package.json b/packages/backend/server/package.json
index 632da0ca1..ad84c82d6 100644
--- a/packages/backend/server/package.json
+++ b/packages/backend/server/package.json
@@ -66,6 +66,7 @@
"@socket.io/redis-adapter": "^8.3.0",
"bullmq": "^5.40.2",
"cookie-parser": "^1.4.7",
+ "date-fns": "^4.0.0",
"dotenv": "^16.4.7",
"eventemitter2": "^6.4.9",
"eventsource-parser": "^3.0.0",
diff --git a/packages/backend/server/src/__tests__/__snapshots__/mailer.spec.ts.md b/packages/backend/server/src/__tests__/__snapshots__/mailer.spec.ts.md
index 171a78b8a..88acddcff 100644
--- a/packages/backend/server/src/__tests__/__snapshots__/mailer.spec.ts.md
+++ b/packages/backend/server/src/__tests__/__snapshots__/mailer.spec.ts.md
@@ -1403,9 +1403,9 @@ Generated by [AVA](https://avajs.dev).
>Test Workspace␊
team workspace expired on␊
- 1/1/2025. All workspace␊
- data will be permanently deleted on␊
- 1/31/2025 (180 days after␊
+ 2025-01-01. All workspace␊
+ data will be permanently deleted on␊
+ 2025-01-31 (180 days after␊
expiration). To prevent data loss, please either:␊
␊
Test Workspace␊
- team workspace data will be permanently deleted in 24 hours on␊
- 1/31/2025. To prevent data␊
+ team workspace data will be permanently deleted in 24 hours on␊
+ 2025-01-31. To prevent data␊
loss, please take immediate action:␊
␊
Test Workspace␊
team workspace will expire on␊
- 1/1/2025. After expiration,␊
- you won't be able to sync or collaborate with team members.␊
- Please renew your subscription to continue using all team␊
- features.␊
+ 2025-01-01. After␊
+ expiration, you won't be able to sync or collaborate with␊
+ team members. Please renew your subscription to continue using␊
+ all team features.␊
Your team workspace expired on{' '}
- {expirationDate.toLocaleDateString()}. All workspace data
- will be permanently deleted on{' '}
- {deletionDate.toLocaleDateString()} (180 days after
- expiration). To prevent data loss, please either:
+ . All workspace data will be
+ permanently deleted on (180 days
+ after expiration). To prevent data loss, please either:
Your team workspace data will be
- permanently deleted in 24 hours on{' '}
- {deletionDate.toLocaleDateString()}. To prevent data
- loss, please take immediate action:
+ permanently deleted in 24 hours on .
+ To prevent data loss, please take immediate action:
Your team workspace will expire on{' '}
- {expirationDate.toLocaleDateString()}. After expiration,
- you won't be able to sync or collaborate with team members.
- Please renew your subscription to continue using all team features.
+ . After expiration, you won't
+ be able to sync or collaborate with team members. Please renew your
+ subscription to continue using all team features.
Your team workspace expired on{' '}
- {expirationDate.toLocaleDateString()}. Your workspace
- can't sync or collaborate with team members. Please renew your
- subscription to restore all team features.
+ . Your workspace can't sync or
+ collaborate with team members. Please renew your subscription to
+ restore all team features.