-
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 two new emails in suspended workspace cleaning
- Loading branch information
1 parent
235bc71
commit 44b03ea
Showing
5 changed files
with
191 additions
and
15 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
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,43 @@ | ||
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 /> | ||
We wanted to inform you that your workspace{''} | ||
<b>{workspaceDisplayName}</b> has been deleted as it remained suspended | ||
for {inactiveDaysBeforeDelete} days following your subscription | ||
expiration. | ||
<br /> | ||
<br /> | ||
All associated data within this workspace has been permanently deleted. | ||
<br /> | ||
<br /> | ||
If you wish to continue using Twenty, you can create a new workspace. | ||
</MainText> | ||
<CallToAction | ||
href="https://app.twenty.com/" | ||
value="Create a new workspace" | ||
/> | ||
</BaseEmail> | ||
); | ||
}; |
51 changes: 51 additions & 0 deletions
51
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,51 @@ | ||
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 > 1 ? `${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 <b>{workspaceDisplayName}</b> workspace has been | ||
suspended for {daysSinceInactive} days due to an expired subscription. | ||
<br /> | ||
<br /> | ||
Please note that the workspace is due for deactivation soon, and all | ||
associated data within this workspace will be deleted. | ||
<br /> | ||
<br /> | ||
If you wish to continue using Twenty, please update your subscription | ||
within the next {remainingDays} {dayOrDays} | ||
{''} | ||
to retain access to your workspace and data. | ||
</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,4 +1,7 @@ | ||
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'; | ||
|
2 changes: 1 addition & 1 deletion
2
...gine/workspace-manager/workspace-cleaner/crons/clean-suspended-workspaces.cron.pattern.ts
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 +1 @@ | ||
export const cleanSuspendedWorkspaceCronPattern = '0 22 * * *'; // Every day at 10pm | ||
export const cleanSuspendedWorkspaceCronPattern = '*/1 * * * *'; // Every day at 10pm |
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