One of the steps to address #8128 How to test: Please change the locale in the settings and click on change password button. A password reset email in the preferred locale will be sent.   Todo: - Remove the hardcoded locales for invitation, warn suspended workspace email, clean suspended workspace emails - Need to test invitation, email verification, warn suspended workspace email, clean suspended workspace emails - The duration variable `5 minutes` is always in english. Do we need to do something about that? It does seems odd in case of chinese translations. Notes: - Only tested the password reset , password update notify templates. - Cant test email verification due to error during sign up `Internal server error: New workspace setup is disabled` --------- Co-authored-by: Félix Malfait <felix@twenty.com>
58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import { t } from '@lingui/core/macro';
|
|
import { Trans } from '@lingui/react/macro';
|
|
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} locale="en">
|
|
<Title value="Suspended Workspace 😴" />
|
|
<MainText>
|
|
{helloString},
|
|
<br />
|
|
<br />
|
|
<Trans>
|
|
It appears that your workspace <b>{workspaceDisplayName}</b> has been
|
|
suspended for {daysSinceInactive} days.
|
|
</Trans>
|
|
<br />
|
|
<br />
|
|
<Trans>
|
|
The workspace will be deactivated in {remainingDays} {dayOrDays}, and
|
|
all its data will be deleted.
|
|
</Trans>
|
|
<br />
|
|
<br />
|
|
<Trans>
|
|
If you wish to continue using Twenty, please update your subscription
|
|
within the next {remainingDays} {dayOrDays}.
|
|
</Trans>
|
|
</MainText>
|
|
<CallToAction
|
|
href="https://app.twenty.com/settings/billing"
|
|
value={t`Update your subscription`}
|
|
/>
|
|
</BaseEmail>
|
|
);
|
|
};
|