-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new emails in suspended workspace cleaning job (#9834)
From: Felix from Twenty <[email protected]> Subject: Action needed to prevent workspace deletion <img width="400" alt="Screenshot 2025-01-24 at 16 31 35" src="https://github.com/user-attachments/assets/8350a499-6815-4b00-a4fb-615b2a3b60e0" /> From: Felix from Twenty <[email protected]> Subject: Your workspace has been deleted <img width="456" alt="Screenshot 2025-01-24 at 16 33 15" src="https://github.com/user-attachments/assets/7e392e7c-519c-4b38-ae8c-ab3c9dd72c24" /> closes [284](twentyhq/core-team-issues#284) & [285](twentyhq/core-team-issues#285) - [parent issue](twentyhq/core-team-issues#179) --------- Co-authored-by: etiennejouan <[email protected]>
- Loading branch information
1 parent
07dec36
commit aacbf11
Showing
13 changed files
with
186 additions
and
494 deletions.
There are no files selected for viewing
48 changes: 0 additions & 48 deletions
48
packages/twenty-emails/src/emails/clean-inactive-workspaces.email.tsx
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
packages/twenty-emails/src/emails/clean-suspended-workspace.email.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { BaseEmail } from 'src/components/BaseEmail'; | ||
import { CallToAction } from 'src/components/CallToAction'; | ||
import { MainText } from 'src/components/MainText'; | ||
import { Title } from 'src/components/Title'; | ||
|
||
type CleanSuspendedWorkspaceEmailProps = { | ||
inactiveDaysBeforeDelete: number; | ||
userName: string; | ||
workspaceDisplayName: string | undefined; | ||
}; | ||
|
||
export const CleanSuspendedWorkspaceEmail = ({ | ||
inactiveDaysBeforeDelete, | ||
userName, | ||
workspaceDisplayName, | ||
}: CleanSuspendedWorkspaceEmailProps) => { | ||
const helloString = userName?.length > 1 ? `Hello ${userName}` : 'Hello'; | ||
|
||
return ( | ||
<BaseEmail width={333}> | ||
<Title value="Deleted Workspace 🥺" /> | ||
<MainText> | ||
{helloString}, | ||
<br /> | ||
<br /> | ||
Your workspace <b>{workspaceDisplayName}</b> has been deleted as your | ||
subscription expired {inactiveDaysBeforeDelete} days ago. | ||
<br /> | ||
<br /> | ||
All data in this workspace has been permanently deleted. | ||
<br /> | ||
<br /> | ||
If you wish to use Twenty again, you can create a new workspace. | ||
</MainText> | ||
<CallToAction | ||
href="https://app.twenty.com/" | ||
value="Create a new workspace" | ||
/> | ||
</BaseEmail> | ||
); | ||
}; |
40 changes: 0 additions & 40 deletions
40
packages/twenty-emails/src/emails/delete-inactive-workspaces.email.tsx
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
packages/twenty-emails/src/emails/warn-suspended-workspace.email.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { BaseEmail } from 'src/components/BaseEmail'; | ||
import { CallToAction } from 'src/components/CallToAction'; | ||
import { MainText } from 'src/components/MainText'; | ||
import { Title } from 'src/components/Title'; | ||
|
||
type WarnSuspendedWorkspaceEmailProps = { | ||
daysSinceInactive: number; | ||
inactiveDaysBeforeDelete: number; | ||
userName: string; | ||
workspaceDisplayName: string | undefined; | ||
}; | ||
|
||
export const WarnSuspendedWorkspaceEmail = ({ | ||
daysSinceInactive, | ||
inactiveDaysBeforeDelete, | ||
userName, | ||
workspaceDisplayName, | ||
}: WarnSuspendedWorkspaceEmailProps) => { | ||
const daysLeft = inactiveDaysBeforeDelete - daysSinceInactive; | ||
const dayOrDays = daysLeft > 1 ? 'days' : 'day'; | ||
const remainingDays = daysLeft > 0 ? `${daysLeft} ` : ''; | ||
|
||
const helloString = userName?.length > 1 ? `Hello ${userName}` : 'Hello'; | ||
|
||
return ( | ||
<BaseEmail width={333}> | ||
<Title value="Suspended Workspace 😴" /> | ||
<MainText> | ||
{helloString}, | ||
<br /> | ||
<br /> | ||
It appears that your workspace <b>{workspaceDisplayName}</b> has been | ||
suspended for {daysSinceInactive} days. | ||
<br /> | ||
<br /> | ||
The workspace will be deactivated in {remainingDays} {dayOrDays}, and | ||
all its data will be deleted. | ||
<br /> | ||
<br /> | ||
If you wish to continue using Twenty, please update your subscription | ||
within the next {remainingDays} {dayOrDays}. | ||
</MainText> | ||
<CallToAction | ||
href="https://app.twenty.com/settings/billing" | ||
value="Update your subscription" | ||
/> | ||
</BaseEmail> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export * from './emails/clean-inactive-workspaces.email'; | ||
export * from './emails/delete-inactive-workspaces.email'; | ||
export * from './emails/clean-suspended-workspace.email'; | ||
export * from './emails/password-reset-link.email'; | ||
export * from './emails/password-update-notify.email'; | ||
export * from './emails/send-email-verification-link.email'; | ||
export * from './emails/send-invite-link.email'; | ||
export * from './emails/warn-suspended-workspace.email'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
.../engine/workspace-manager/workspace-cleaner/commands/clean-inactive-workspaces.command.ts
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
...kspace-manager/workspace-cleaner/commands/start-clean-inactive-workspaces.cron.command.ts
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
...rkspace-manager/workspace-cleaner/commands/stop-clean-inactive-workspaces.cron.command.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
...engine/workspace-manager/workspace-cleaner/crons/clean-inactive-workspace.cron.pattern.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.