feat: Add team deletion flow for cloud-hosted (#5717)
This commit is contained in:
60
server/emails/templates/ConfirmTeamDeleteEmail.tsx
Normal file
60
server/emails/templates/ConfirmTeamDeleteEmail.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
import * as React from "react";
|
||||
import env from "@server/env";
|
||||
import BaseEmail, { EmailProps } from "./BaseEmail";
|
||||
import Body from "./components/Body";
|
||||
import CopyableCode from "./components/CopyableCode";
|
||||
import EmailTemplate from "./components/EmailLayout";
|
||||
import EmptySpace from "./components/EmptySpace";
|
||||
import Footer from "./components/Footer";
|
||||
import Header from "./components/Header";
|
||||
import Heading from "./components/Heading";
|
||||
|
||||
type Props = EmailProps & {
|
||||
deleteConfirmationCode: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Email sent to a user when they request to delete their workspace.
|
||||
*/
|
||||
export default class ConfirmTeamDeleteEmail extends BaseEmail<
|
||||
Props,
|
||||
Record<string, any>
|
||||
> {
|
||||
protected subject() {
|
||||
return `Your workspace deletion request`;
|
||||
}
|
||||
|
||||
protected preview() {
|
||||
return `Your requested workspace deletion code`;
|
||||
}
|
||||
|
||||
protected renderAsText({ deleteConfirmationCode }: Props): string {
|
||||
return `
|
||||
You requested to permanantly delete your ${env.APP_NAME} workspace. Please enter the code below to confirm the workspace deletion.
|
||||
|
||||
Code: ${deleteConfirmationCode}
|
||||
`;
|
||||
}
|
||||
|
||||
protected render({ deleteConfirmationCode }: Props) {
|
||||
return (
|
||||
<EmailTemplate>
|
||||
<Header />
|
||||
|
||||
<Body>
|
||||
<Heading>Your workspace deletion request</Heading>
|
||||
<p>
|
||||
You requested to permanantly delete your {env.APP_NAME} workspace.
|
||||
Please enter the code below to confirm your workspace deletion.
|
||||
</p>
|
||||
<EmptySpace height={5} />
|
||||
<p>
|
||||
<CopyableCode>{deleteConfirmationCode}</CopyableCode>
|
||||
</p>
|
||||
</Body>
|
||||
|
||||
<Footer />
|
||||
</EmailTemplate>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user