Files
twenty_crm/packages/twenty-emails/src/emails/delete-inactive-workspaces.email.tsx
Thaïs a654205dbc chore: set up twenty-emails config so build isn't needed in development (#3619)
* chore: set up twenty-emails config so build isn't needed in development

* fix: fix script dependency

* chore: use @vitejs/plugin-react-swc

* Remove useless dependancy

* Fix typing

* chore: use baseUrl in twenty-emails

* chore: fix docker server prod build

* refactor: optimize Docker file and tsconfig

* fix: fix WORKDIR in docker

---------

Co-authored-by: martmull <martmull@hotmail.fr>
2024-01-29 06:17:12 -03:00

40 lines
1.2 KiB
TypeScript

import { Column, Row, Section } from '@react-email/components';
import { BaseEmail } from 'src/components/BaseEmail';
import { MainText } from 'src/components/MainText';
import { Title } from 'src/components/Title';
type DeleteInactiveWorkspaceEmailData = {
daysSinceInactive: number;
workspaceId: string;
};
export const DeleteInactiveWorkspaceEmail = (
workspacesToDelete: DeleteInactiveWorkspaceEmailData[],
) => {
const minDaysSinceInactive = Math.min(
...workspacesToDelete.map(
(workspaceToDelete) => workspaceToDelete.daysSinceInactive,
),
);
return (
<BaseEmail width={350}>
<Title value="Dead Workspaces 😵 that should be deleted" />
<MainText>
List of <b>workspaceIds</b> inactive since at least{' '}
<b>{minDaysSinceInactive} days</b>:
<Section>
{workspacesToDelete.map((workspaceToDelete) => {
return (
<Row key={workspaceToDelete.workspaceId}>
<Column>{workspaceToDelete.workspaceId}</Column>
</Row>
);
})}
</Section>
</MainText>
</BaseEmail>
);
};
export default DeleteInactiveWorkspaceEmail;