feat(MED-48): add synlab analysis package email
This commit is contained in:
97
packages/email-templates/src/emails/synlab.email.tsx
Normal file
97
packages/email-templates/src/emails/synlab.email.tsx
Normal file
@@ -0,0 +1,97 @@
|
||||
import {
|
||||
Body,
|
||||
Head,
|
||||
Html,
|
||||
Preview,
|
||||
Tailwind,
|
||||
Text,
|
||||
render,
|
||||
} from '@react-email/components';
|
||||
|
||||
import { BodyStyle } from '../components/body-style';
|
||||
import { EmailContent } from '../components/content';
|
||||
import { EmailHeader } from '../components/header';
|
||||
import { EmailHeading } from '../components/heading';
|
||||
import { EmailWrapper } from '../components/wrapper';
|
||||
import { initializeEmailI18n } from '../lib/i18n';
|
||||
import CommonFooter from '../components/common-footer';
|
||||
|
||||
interface Props {
|
||||
analysisPackageName: string;
|
||||
language?: string;
|
||||
personName: string;
|
||||
partnerLocationName: string;
|
||||
}
|
||||
|
||||
export async function renderSynlabAnalysisPackageEmail(props: Props) {
|
||||
const namespace = 'synlab-email';
|
||||
|
||||
const { t } = await initializeEmailI18n({
|
||||
language: props.language,
|
||||
namespace: [namespace, 'common'],
|
||||
});
|
||||
|
||||
const previewText = t(`${namespace}:previewText`);
|
||||
const subject = t(`${namespace}:subject`);
|
||||
|
||||
const heading = t(`${namespace}:heading`, {
|
||||
analysisPackageName: props.analysisPackageName,
|
||||
});
|
||||
|
||||
const hello = t(`${namespace}:hello`, {
|
||||
personName: props.personName,
|
||||
});
|
||||
|
||||
const lines = [
|
||||
t(`${namespace}:lines1`, {
|
||||
analysisPackageName: props.analysisPackageName,
|
||||
partnerLocationName: props.partnerLocationName,
|
||||
}),
|
||||
t(`${namespace}:lines2`),
|
||||
t(`${namespace}:lines3`),
|
||||
t(`${namespace}:lines4`),
|
||||
t(`${namespace}:lines5`),
|
||||
t(`${namespace}:lines6`),
|
||||
];
|
||||
|
||||
const html = await render(
|
||||
<Html>
|
||||
<Head>
|
||||
<BodyStyle />
|
||||
</Head>
|
||||
|
||||
<Preview>{previewText}</Preview>
|
||||
|
||||
<Tailwind>
|
||||
<Body>
|
||||
<EmailWrapper>
|
||||
<EmailHeader>
|
||||
<EmailHeading>{heading}</EmailHeading>
|
||||
</EmailHeader>
|
||||
|
||||
<EmailContent>
|
||||
<Text className="text-[16px] leading-[24px] text-[#242424]">
|
||||
{hello}
|
||||
</Text>
|
||||
|
||||
{lines.map((line, index) => (
|
||||
<Text
|
||||
key={index}
|
||||
className="text-[16px] leading-[24px] text-[#242424]"
|
||||
dangerouslySetInnerHTML={{ __html: line }}
|
||||
/>
|
||||
))}
|
||||
|
||||
<CommonFooter t={t} />
|
||||
</EmailContent>
|
||||
</EmailWrapper>
|
||||
</Body>
|
||||
</Tailwind>
|
||||
</Html>,
|
||||
);
|
||||
|
||||
return {
|
||||
html,
|
||||
subject,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user