Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 45 additions & 111 deletions apps/demo/emails/magic-links/notion-magic-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import {
Img,
Link,
Preview,
Tailwind,
Text,
} from '@react-email/components';
import tailwindConfig from '../tailwind.config';

interface NotionMagicLinkEmailProps {
loginCode?: string;
Expand All @@ -23,66 +25,54 @@ export const NotionMagicLinkEmail = ({
}: NotionMagicLinkEmailProps) => (
<Html>
<Head />
<Body style={main}>
<Preview>Log in with this magic link</Preview>
<Container style={container}>
<Heading style={h1}>Login</Heading>
<Link
href="https://notion.so"
target="_blank"
style={{
...link,
display: 'block',
marginBottom: '16px',
}}
>
Click here to log in with this magic link
</Link>
<Text style={{ ...text, marginBottom: '14px' }}>
Or, copy and paste this temporary login code:
</Text>
<code style={code}>{loginCode}</code>
<Text
style={{
...text,
color: '#ababab',
marginTop: '14px',
marginBottom: '16px',
}}
>
If you didn&apos;t try to login, you can safely ignore this email.
</Text>
<Text
style={{
...text,
color: '#ababab',
marginTop: '12px',
marginBottom: '38px',
}}
>
Hint: You can set a permanent password in Settings & members → My
account.
</Text>
<Img
src={`${baseUrl}/static/notion-logo.png`}
width="32"
height="32"
alt="Notion's Logo"
/>
<Text style={footer}>
<Tailwind config={tailwindConfig}>
<Body className="bg-white font-notion">
<Preview>Log in with this magic link</Preview>
<Container className="px-3 mx-auto">
<Heading className="text-[#333] text-[24px] my-10 mx-0 p-0">
Login
</Heading>
<Link
href="https://notion.so"
target="_blank"
style={{ ...link, color: '#898989' }}
className="text-[#2754C5] text-[14px] underline mb-4 block"
>
Notion.so
Click here to log in with this magic link
</Link>
, the all-in-one-workspace
<br />
for your notes, tasks, wikis, and databases.
</Text>
</Container>
</Body>
<Text className="text-[#333] text-[14px] my-6 mb-3.5">
Or, copy and paste this temporary login code:
</Text>
<code className="inline-block py-4 px-[4.5%] w-9/10 bg-[#f4f4f4] rounded-md border border-solid border-[#eee] text-[#333]">
{loginCode}
</code>
<Text className="text-[#ababab] text-[14px] mt-3.5 mb-4">
If you didn&apos;t try to login, you can safely ignore this email.
</Text>
<Text className="text-[#ababab] text-[14px] mt-3.5 mb-9.5">
Hint: You can set a permanent password in Settings & members → My
account.
</Text>
<Img
src={`${baseUrl}/static/notion-logo.png`}
width="32"
height="32"
alt="Notion's Logo"
/>
<Text className="text-[#898989] text-[12px] leading-[22px] mt-3 mb-6">
<Link
href="https://notion.so"
target="_blank"
className="text-[#898989] text-[14px] underline"
>
Notion.so
</Link>
, the all-in-one-workspace
<br />
for your notes, tasks, wikis, and databases.
</Text>
</Container>
</Body>
</Tailwind>
</Html>
);

Expand All @@ -91,59 +81,3 @@ NotionMagicLinkEmail.PreviewProps = {
} as NotionMagicLinkEmailProps;

export default NotionMagicLinkEmail;

const main = {
backgroundColor: '#ffffff',
};

const container = {
paddingLeft: '12px',
paddingRight: '12px',
margin: '0 auto',
};

const h1 = {
color: '#333',
fontFamily:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
fontSize: '24px',
fontWeight: 'bold',
margin: '40px 0',
padding: '0',
};

const link = {
color: '#2754C5',
fontFamily:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
fontSize: '14px',
textDecoration: 'underline',
};

const text = {
color: '#333',
fontFamily:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
fontSize: '14px',
margin: '24px 0',
};

const footer = {
color: '#898989',
fontFamily:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
fontSize: '12px',
lineHeight: '22px',
marginTop: '12px',
marginBottom: '24px',
};

const code = {
display: 'inline-block',
padding: '16px 4.5%',
width: '90.5%',
backgroundColor: '#f4f4f4',
borderRadius: '5px',
border: '1px solid #eee',
color: '#333',
};
2 changes: 2 additions & 0 deletions apps/demo/emails/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default {
'Ubuntu',
'sans-serif',
],
notion:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
},
},
} satisfies TailwindConfig;
188 changes: 0 additions & 188 deletions demo

This file was deleted.

Loading
Loading