feat(server): display date in yyyy-MM-dd format on email (#10916)

This commit is contained in:
fengmk2
2025-03-18 01:00:13 +00:00
parent 3f0981a6fa
commit 4a3180ee04
10 changed files with 39 additions and 27 deletions

View File

@@ -66,6 +66,7 @@
"@socket.io/redis-adapter": "^8.3.0", "@socket.io/redis-adapter": "^8.3.0",
"bullmq": "^5.40.2", "bullmq": "^5.40.2",
"cookie-parser": "^1.4.7", "cookie-parser": "^1.4.7",
"date-fns": "^4.0.0",
"dotenv": "^16.4.7", "dotenv": "^16.4.7",
"eventemitter2": "^6.4.9", "eventemitter2": "^6.4.9",
"eventsource-parser": "^3.0.0", "eventsource-parser": "^3.0.0",

View File

@@ -1403,9 +1403,9 @@ Generated by [AVA](https://avajs.dev).
>Test Workspace</span␊ >Test Workspace</span␊
>␊ >␊
team workspace expired on<!-- -->␊ team workspace expired on<!-- -->␊
<span style="font-weight:600">1/1/2025</span>. All workspace␊ <span style="font-weight:600">2025-01-01</span>. All workspace␊
data will be permanently deleted on<!-- -->␊ data will be permanently deleted on␊
<span style="font-weight:600">1/31/2025</span> (180 days after␊ <span style="font-weight:600">2025-01-31</span> (180 days after␊
expiration). To prevent data loss, please either:␊ expiration). To prevent data loss, please either:␊
<li>␊ <li>␊
<span␊ <span␊
@@ -1510,8 +1510,8 @@ Generated by [AVA](https://avajs.dev).
style="font-weight:600"␊ style="font-weight:600"␊
>Test Workspace</span␊ >Test Workspace</span␊
>␊ >␊
team workspace data will be permanently deleted in 24 hours on<!-- -->␊ team workspace data will be permanently deleted in 24 hours on␊
<span style="font-weight:600">1/31/2025</span>. To prevent data␊ <span style="font-weight:600">2025-01-31</span>. To prevent data␊
loss, please take immediate action:␊ loss, please take immediate action:␊
<li>␊ <li>␊
<span␊ <span␊
@@ -1775,10 +1775,10 @@ Generated by [AVA](https://avajs.dev).
>Test Workspace</span␊ >Test Workspace</span␊
>␊ >␊
team workspace will expire on<!-- -->␊ team workspace will expire on<!-- -->␊
<span style="font-weight:600">1/1/2025</span>. After expiration,␊ <span style="font-weight:600">2025-01-01</span>. After␊
you won&#x27;t be able to sync or collaborate with team members.␊ expiration, you won&#x27;t be able to sync or collaborate with␊
Please renew your subscription to continue using all team␊ team members. Please renew your subscription to continue using␊
features.␊ all team features.␊
</p>␊ </p>␊
</tr>␊ </tr>␊
</tbody>␊ </tbody>␊
@@ -1870,7 +1870,7 @@ Generated by [AVA](https://avajs.dev).
>Test Workspace</span␊ >Test Workspace</span␊
>␊ >␊
team workspace expired on<!-- -->␊ team workspace expired on<!-- -->␊
<span style="font-weight:600">1/1/2025</span>. Your workspace␊ <span style="font-weight:600">2025-01-01</span>. Your workspace␊
can&#x27;t sync or collaborate with team members. Please renew␊ can&#x27;t sync or collaborate with team members. Please renew␊
your subscription to restore all team features.␊ your subscription to restore all team features.␊
</p>␊ </p>␊

View File

@@ -0,0 +1,11 @@
import { format } from 'date-fns';
import { Bold } from './template';
export interface DateProps {
value: Date;
}
export const IOSDate = (props: DateProps) => {
return <Bold>{format(props.value, 'yyyy-MM-dd')}</Bold>;
};

View File

@@ -1,3 +1,4 @@
export * from './date';
export * from './template'; export * from './template';
export * from './user'; export * from './user';
export * from './workspace'; export * from './workspace';

View File

@@ -1,8 +1,8 @@
import { TEST_WORKSPACE } from '../common'; import { TEST_WORKSPACE } from '../common';
import { import {
Bold,
Button, Button,
Content, Content,
IOSDate,
P, P,
Template, Template,
Text, Text,
@@ -27,10 +27,9 @@ export default function TeamDeleteInOneMonth(props: TeamDeleteInOneMonthProps) {
<Content> <Content>
<P> <P>
Your <Workspace {...workspace} /> team workspace expired on{' '} Your <Workspace {...workspace} /> team workspace expired on{' '}
<Bold>{expirationDate.toLocaleDateString()}</Bold>. All workspace data <IOSDate value={expirationDate} />. All workspace data will be
will be permanently deleted on{' '} permanently deleted on <IOSDate value={deletionDate} /> (180 days
<Bold>{deletionDate.toLocaleDateString()}</Bold> (180 days after after expiration). To prevent data loss, please either:
expiration). To prevent data loss, please either:
<li> <li>
<Text>Renew your subscription to restore team features</Text> <Text>Renew your subscription to restore team features</Text>
</li> </li>

View File

@@ -1,8 +1,8 @@
import { TEST_WORKSPACE } from '../common'; import { TEST_WORKSPACE } from '../common';
import { import {
Bold,
Button, Button,
Content, Content,
IOSDate,
P, P,
Template, Template,
Text, Text,
@@ -26,9 +26,8 @@ export default function TeamDeleteIn24Hours(props: TeamDeleteIn24HoursProps) {
<Content> <Content>
<P> <P>
Your <Workspace {...workspace} /> team workspace data will be Your <Workspace {...workspace} /> team workspace data will be
permanently deleted in 24 hours on{' '} permanently deleted in 24 hours on <IOSDate value={deletionDate} />.
<Bold>{deletionDate.toLocaleDateString()}</Bold>. To prevent data To prevent data loss, please take immediate action:
loss, please take immediate action:
<li> <li>
<Text>Renew your subscription to restore team features</Text> <Text>Renew your subscription to restore team features</Text>
</li> </li>

View File

@@ -1,8 +1,8 @@
import { TEST_WORKSPACE } from '../common'; import { TEST_WORKSPACE } from '../common';
import { import {
Bold,
Button, Button,
Content, Content,
IOSDate,
P, P,
Template, Template,
Title, Title,
@@ -25,9 +25,9 @@ export default function TeamExpireSoon(props: TeamExpireSoonProps) {
<Content> <Content>
<P> <P>
Your <Workspace {...workspace} /> team workspace will expire on{' '} Your <Workspace {...workspace} /> team workspace will expire on{' '}
<Bold>{expirationDate.toLocaleDateString()}</Bold>. After expiration, <IOSDate value={expirationDate} />. After expiration, you won&apos;t
you won&apos;t be able to sync or collaborate with team members. be able to sync or collaborate with team members. Please renew your
Please renew your subscription to continue using all team features. subscription to continue using all team features.
</P> </P>
<Button href={url}>Go to Billing</Button> <Button href={url}>Go to Billing</Button>
</Content> </Content>

View File

@@ -1,8 +1,8 @@
import { TEST_WORKSPACE } from '../common'; import { TEST_WORKSPACE } from '../common';
import { import {
Bold,
Button, Button,
Content, Content,
IOSDate,
P, P,
Template, Template,
Title, Title,
@@ -25,9 +25,9 @@ export default function TeamExpired(props: TeamExpiredProps) {
<Content> <Content>
<P> <P>
Your <Workspace {...workspace} /> team workspace expired on{' '} Your <Workspace {...workspace} /> team workspace expired on{' '}
<Bold>{expirationDate.toLocaleDateString()}</Bold>. Your workspace <IOSDate value={expirationDate} />. Your workspace can&apos;t sync or
can&apos;t sync or collaborate with team members. Please renew your collaborate with team members. Please renew your subscription to
subscription to restore all team features. restore all team features.
</P> </P>
<Button href={url}>Go to Billing</Button> <Button href={url}>Go to Billing</Button>
</Content> </Content>

View File

@@ -905,6 +905,7 @@ __metadata:
c8: "npm:^10.1.3" c8: "npm:^10.1.3"
cookie-parser: "npm:^1.4.7" cookie-parser: "npm:^1.4.7"
cross-env: "npm:^7.0.3" cross-env: "npm:^7.0.3"
date-fns: "npm:^4.0.0"
dotenv: "npm:^16.4.7" dotenv: "npm:^16.4.7"
eventemitter2: "npm:^6.4.9" eventemitter2: "npm:^6.4.9"
eventsource-parser: "npm:^3.0.0" eventsource-parser: "npm:^3.0.0"