mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
## Description Support setting a document language that will control the language used for sending emails to recipients. Additional work has been done to convert all emails to using our i18n implementation so we can later add controls for sending other kinds of emails in a users target language. ## Related Issue N/A ## Changes Made - Added `<Trans>` and `msg` macros to emails - Introduced a new `renderEmailWithI18N` utility in the lib package - Updated all emails to use the `<Tailwind>` component at the top level due to rendering constraints - Updated the `i18n.server.tsx` file to not use a top level await ## Testing Performed - Configured document language and verified emails were sent in the expected language - Created a document from a template and verified that the templates language was transferred to the document
73 lines
2.3 KiB
TypeScript
73 lines
2.3 KiB
TypeScript
import { Trans } from '@lingui/macro';
|
|
|
|
import { Button, Column, Img, Section, Text } from '../components';
|
|
import { TemplateDocumentImage } from './template-document-image';
|
|
|
|
export interface TemplateDocumentCompletedProps {
|
|
downloadLink: string;
|
|
documentName: string;
|
|
assetBaseUrl: string;
|
|
customBody?: string;
|
|
}
|
|
|
|
export const TemplateDocumentCompleted = ({
|
|
downloadLink,
|
|
documentName,
|
|
assetBaseUrl,
|
|
customBody,
|
|
}: TemplateDocumentCompletedProps) => {
|
|
const getAssetUrl = (path: string) => {
|
|
return new URL(path, assetBaseUrl).toString();
|
|
};
|
|
|
|
return (
|
|
<>
|
|
<TemplateDocumentImage className="mt-6" assetBaseUrl={assetBaseUrl} />
|
|
|
|
<Section>
|
|
<Section className="mb-4">
|
|
<Column align="center">
|
|
<Text className="text-base font-semibold text-[#7AC455]">
|
|
<Img
|
|
src={getAssetUrl('/static/completed.png')}
|
|
className="-mt-0.5 mr-2 inline h-7 w-7 align-middle"
|
|
/>
|
|
<Trans>Completed</Trans>
|
|
</Text>
|
|
</Column>
|
|
</Section>
|
|
|
|
<Text className="text-primary mb-0 text-center text-lg font-semibold">
|
|
<Trans>{customBody ?? `“${documentName}” was signed by all signers`}</Trans>
|
|
</Text>
|
|
|
|
<Text className="my-1 text-center text-base text-slate-400">
|
|
<Trans>Continue by downloading the document.</Trans>
|
|
</Text>
|
|
|
|
<Section className="mb-6 mt-8 text-center">
|
|
{/* <Button
|
|
className="mr-4 inline-flex items-center justify-center rounded-lg border border-solid border-slate-200 px-4 py-2 text-center text-sm font-medium text-black no-underline"
|
|
href={reviewLink}
|
|
>
|
|
<Img src={getAssetUrl('/static/review.png')} className="-mb-1 mr-2 inline h-5 w-5" />
|
|
Review
|
|
</Button> */}
|
|
<Button
|
|
className="rounded-lg border border-solid border-slate-200 px-4 py-2 text-center text-sm font-medium text-black no-underline"
|
|
href={downloadLink}
|
|
>
|
|
<Img
|
|
src={getAssetUrl('/static/download.png')}
|
|
className="mb-0.5 mr-2 inline h-5 w-5 align-middle"
|
|
/>
|
|
<Trans>Download</Trans>
|
|
</Button>
|
|
</Section>
|
|
</Section>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default TemplateDocumentCompleted;
|