Update CSS in email templates
Enhanced the design of the 'invite-user' and 'confirm-email' templates by adding new CSS code. This CSS code professionaly styles the email, improving readability and user experience.
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,16 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
export function BodyStyle() {
|
||||||
|
return (
|
||||||
|
<style>
|
||||||
|
{`
|
||||||
|
body {
|
||||||
|
background-color: #fff;
|
||||||
|
margin: auto;
|
||||||
|
font-family: sans-serif;
|
||||||
|
color: #484848;
|
||||||
|
}
|
||||||
|
`}
|
||||||
|
</style>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { Button } from '@react-email/components';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
export function CtaButton(
|
||||||
|
props: React.PropsWithChildren<{
|
||||||
|
href: string;
|
||||||
|
}>,
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
className="w-full bg-[#000000] rounded text-white text-[14px] font-semibold no-underline text-center py-3"
|
||||||
|
href={props.href}
|
||||||
|
>
|
||||||
|
{props.children}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { Container, Text } from '@react-email/components';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
export function EmailFooter(props: React.PropsWithChildren) {
|
||||||
|
return (
|
||||||
|
<Container>
|
||||||
|
<Text className="text-[12px] leading-[24px] text-gray-300 px-4">
|
||||||
|
{props.children}
|
||||||
|
</Text>
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import * as React from 'react';
|
||||||
|
import { Heading } from '@react-email/components';
|
||||||
|
|
||||||
|
export function EmailHeading(props: React.PropsWithChildren) {
|
||||||
|
return (
|
||||||
|
<Heading className="text-black font-sans tracking-tight text-[20px] font-normal p-0 mx-0">
|
||||||
|
{props.children}
|
||||||
|
</Heading>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { Container } from '@react-email/components';
|
||||||
|
import * as React from 'react';
|
||||||
|
|
||||||
|
export function EmailWrapper(
|
||||||
|
props: React.PropsWithChildren<{
|
||||||
|
className?: string;
|
||||||
|
}>,
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<Container
|
||||||
|
style={{
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
margin: 'auto',
|
||||||
|
fontFamily: 'sans-serif',
|
||||||
|
color: '#484848',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Container
|
||||||
|
style={{
|
||||||
|
maxWidth: '535px',
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
margin: 'auto',
|
||||||
|
}}
|
||||||
|
className={'my-[36px] mx-auto px-4 ' + props.className || ''}
|
||||||
|
>
|
||||||
|
{props.children}
|
||||||
|
</Container>
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
Body,
|
Body,
|
||||||
Container,
|
|
||||||
Head,
|
Head,
|
||||||
Heading,
|
|
||||||
Html,
|
Html,
|
||||||
Preview,
|
Preview,
|
||||||
Tailwind,
|
Tailwind,
|
||||||
@@ -10,6 +8,12 @@ import {
|
|||||||
render,
|
render,
|
||||||
} from '@react-email/components';
|
} from '@react-email/components';
|
||||||
|
|
||||||
|
import { BodyStyle } from '../components/body-style';
|
||||||
|
import { EmailContent } from '../components/content';
|
||||||
|
import { EmailFooter } from '../components/footer';
|
||||||
|
import { EmailHeader } from '../components/header';
|
||||||
|
import { EmailHeading } from '../components/heading';
|
||||||
|
import { EmailWrapper } from '../components/wrapper';
|
||||||
import { initializeEmailI18n } from '../lib/i18n';
|
import { initializeEmailI18n } from '../lib/i18n';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -36,44 +40,51 @@ export async function renderAccountDeleteEmail(props: Props) {
|
|||||||
|
|
||||||
const html = render(
|
const html = render(
|
||||||
<Html>
|
<Html>
|
||||||
<Head />
|
<Head>
|
||||||
|
<BodyStyle />
|
||||||
|
</Head>
|
||||||
|
|
||||||
<Preview>{previewText}</Preview>
|
<Preview>{previewText}</Preview>
|
||||||
|
|
||||||
<Tailwind>
|
<Tailwind>
|
||||||
<Body className="mx-auto my-auto bg-[#ffffff] font-sans">
|
<Body>
|
||||||
<Container className="mx-auto my-[40px] w-[465px] rounded-lg border border-solid border-[#eaeaea] bg-white p-[20px]">
|
<EmailWrapper>
|
||||||
<Heading className="mx-0 my-[30px] p-0 text-center text-[24px] font-bold text-black">
|
<EmailHeader>
|
||||||
{previewText}
|
<EmailHeading>{previewText}</EmailHeading>
|
||||||
</Heading>
|
</EmailHeader>
|
||||||
|
|
||||||
<Text className="text-[14px] leading-[24px] text-black">
|
<EmailContent>
|
||||||
{t(`${namespace}:hello`, {
|
<Text className="text-[14px] leading-[24px] text-black">
|
||||||
displayName: props.userDisplayName,
|
{t(`${namespace}:hello`, {
|
||||||
})}
|
displayName: props.userDisplayName,
|
||||||
</Text>
|
})}
|
||||||
|
</Text>
|
||||||
|
|
||||||
<Text className="text-[14px] leading-[24px] text-black">
|
<Text className="text-[14px] leading-[24px] text-black">
|
||||||
{t(`${namespace}:paragraph1`, {
|
{t(`${namespace}:paragraph1`, {
|
||||||
productName: props.productName,
|
productName: props.productName,
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text className="text-[14px] leading-[24px] text-black">
|
<Text className="text-[14px] leading-[24px] text-black">
|
||||||
{t(`${namespace}:paragraph2`)}
|
{t(`${namespace}:paragraph2`)}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text className="text-[14px] leading-[24px] text-black">
|
<Text className="text-[14px] leading-[24px] text-black">
|
||||||
{t(`${namespace}:paragraph3`, {
|
{t(`${namespace}:paragraph3`, {
|
||||||
productName: props.productName,
|
productName: props.productName,
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
<Text className="text-[14px] leading-[24px] text-black">
|
<Text className="text-[14px] leading-[24px] text-black">
|
||||||
{t(`${namespace}:paragraph4`, {
|
{t(`${namespace}:paragraph4`, {
|
||||||
productName: props.productName,
|
productName: props.productName,
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
</Container>
|
</EmailContent>
|
||||||
|
|
||||||
|
<EmailFooter>{props.productName}</EmailFooter>
|
||||||
|
</EmailWrapper>
|
||||||
</Body>
|
</Body>
|
||||||
</Tailwind>
|
</Tailwind>
|
||||||
</Html>,
|
</Html>,
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
Body,
|
Body,
|
||||||
Button,
|
|
||||||
Column,
|
Column,
|
||||||
Container,
|
|
||||||
Head,
|
Head,
|
||||||
Heading,
|
|
||||||
Hr,
|
Hr,
|
||||||
Html,
|
Html,
|
||||||
Img,
|
Img,
|
||||||
@@ -17,6 +14,13 @@ import {
|
|||||||
render,
|
render,
|
||||||
} from '@react-email/components';
|
} from '@react-email/components';
|
||||||
|
|
||||||
|
import { BodyStyle } from '../components/body-style';
|
||||||
|
import { EmailContent } from '../components/content';
|
||||||
|
import { CtaButton } from '../components/cta-button';
|
||||||
|
import { EmailFooter } from '../components/footer';
|
||||||
|
import { EmailHeader } from '../components/header';
|
||||||
|
import { EmailHeading } from '../components/heading';
|
||||||
|
import { EmailWrapper } from '../components/wrapper';
|
||||||
import { initializeEmailI18n } from '../lib/i18n';
|
import { initializeEmailI18n } from '../lib/i18n';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
@@ -61,64 +65,66 @@ export async function renderInviteEmail(props: Props) {
|
|||||||
|
|
||||||
const html = render(
|
const html = render(
|
||||||
<Html>
|
<Html>
|
||||||
<Head />
|
<Head>
|
||||||
|
<BodyStyle />
|
||||||
|
</Head>
|
||||||
|
|
||||||
<Preview>{previewText}</Preview>
|
<Preview>{previewText}</Preview>
|
||||||
|
|
||||||
<Tailwind>
|
<Tailwind>
|
||||||
<Body className="mx-auto my-auto bg-[#ffffff] font-sans">
|
<Body>
|
||||||
<Container className="mx-auto my-[40px] w-[465px] rounded-lg border border-solid border-[#eaeaea] bg-white p-[20px]">
|
<EmailWrapper>
|
||||||
<Heading className="mx-0 my-[30px] p-0 text-center text-[24px] font-normal text-black">
|
<EmailHeader>
|
||||||
{heading}
|
<EmailHeading>{heading}</EmailHeading>
|
||||||
</Heading>
|
</EmailHeader>
|
||||||
|
|
||||||
<Text className="text-[14px] leading-[24px] text-black">
|
<EmailContent>
|
||||||
{hello}
|
<Text className="text-[14px] leading-[24px] text-black">
|
||||||
</Text>
|
{hello}
|
||||||
|
</Text>
|
||||||
|
|
||||||
<Text
|
<Text
|
||||||
className="text-[14px] leading-[24px] text-black"
|
className="text-[14px] leading-[24px] text-black"
|
||||||
dangerouslySetInnerHTML={{ __html: mainText }}
|
dangerouslySetInnerHTML={{ __html: mainText }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{props.teamLogo && (
|
{props.teamLogo && (
|
||||||
<Section>
|
<Section>
|
||||||
<Row>
|
<Row>
|
||||||
<Column align="center">
|
<Column align="center">
|
||||||
<Img
|
<Img
|
||||||
className="rounded-full"
|
className="rounded-full"
|
||||||
src={props.teamLogo}
|
src={props.teamLogo}
|
||||||
width="64"
|
width="64"
|
||||||
height="64"
|
height="64"
|
||||||
/>
|
/>
|
||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
|
</Section>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<Section className="mb-[32px] mt-[32px] text-center">
|
||||||
|
<CtaButton href={props.link}>{joinTeam}</CtaButton>
|
||||||
</Section>
|
</Section>
|
||||||
)}
|
|
||||||
|
|
||||||
<Section className="mb-[32px] mt-[32px] text-center">
|
<Text className="text-[14px] leading-[24px] text-black">
|
||||||
<Button
|
{t(`${namespace}:copyPasteLink`)}{' '}
|
||||||
className="rounded bg-[#000000] px-[20px] py-[12px] text-center text-[12px] font-semibold text-white no-underline"
|
<Link href={props.link} className="text-blue-600 no-underline">
|
||||||
href={props.link}
|
{props.link}
|
||||||
>
|
</Link>
|
||||||
{joinTeam}
|
</Text>
|
||||||
</Button>
|
|
||||||
</Section>
|
|
||||||
|
|
||||||
<Text className="text-[14px] leading-[24px] text-black">
|
<Hr className="mx-0 my-[26px] w-full border border-solid border-[#eaeaea]" />
|
||||||
{t(`${namespace}:copyPasteLink`)}{' '}
|
|
||||||
<Link href={props.link} className="text-blue-600 no-underline">
|
|
||||||
{props.link}
|
|
||||||
</Link>
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<Hr className="mx-0 my-[26px] w-full border border-solid border-[#eaeaea]" />
|
<Text className="text-[12px] leading-[24px] text-[#666666]">
|
||||||
|
{t(`${namespace}:invitationIntendedFor`, {
|
||||||
|
invitedUserEmail: props.invitedUserEmail,
|
||||||
|
})}
|
||||||
|
</Text>
|
||||||
|
</EmailContent>
|
||||||
|
|
||||||
<Text className="text-[12px] leading-[24px] text-[#666666]">
|
<EmailFooter>{props.productName}</EmailFooter>
|
||||||
{t(`${namespace}:invitationIntendedFor`, {
|
</EmailWrapper>
|
||||||
invitedUserEmail: props.invitedUserEmail,
|
|
||||||
})}
|
|
||||||
</Text>
|
|
||||||
</Container>
|
|
||||||
</Body>
|
</Body>
|
||||||
</Tailwind>
|
</Tailwind>
|
||||||
</Html>,
|
</Html>,
|
||||||
|
|||||||
Reference in New Issue
Block a user