Skip to content
Open
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-2xl my-10 mx-0 p-0">
Login
</Heading>
<Link
href="https://notion.so"
target="_blank"
style={{ ...link, color: '#898989' }}
className="text-[#2754C5] text-sm 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-sm 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]">
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w-9/10 isn’t generated by the email Tailwind config, so the login code block loses its intended 90% width. Please switch to an arbitrary value utility.

Prompt for AI agents
Address the following comment on apps/demo/emails/magic-links/notion-magic-link.tsx at line 45:

<comment>`w-9/10` isn’t generated by the email Tailwind config, so the login code block loses its intended 90% width. Please switch to an arbitrary value utility.</comment>

<file context>
@@ -23,66 +25,54 @@ export const NotionMagicLinkEmail = ({
+          &lt;Text className=&quot;text-[#333] text-sm my-6 mb-3.5&quot;&gt;
+            Or, copy and paste this temporary login code:
+          &lt;/Text&gt;
+          &lt;code className=&quot;inline-block py-4 px-[4.5%] w-9/10 bg-[#f4f4f4] rounded-md border border-solid border-[#eee] text-[#333]&quot;&gt;
+            {loginCode}
+          &lt;/code&gt;
</file context>
Fix with Cubic

{loginCode}
</code>
<Text className="text-[#ababab] text-sm 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-sm mt-3.5 mb-9.5">
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb-9.5 isn’t part of the Tailwind preset you’re using, so the helper text loses its 38px bottom margin. Use an arbitrary spacing value to keep the layout consistent.

Prompt for AI agents
Address the following comment on apps/demo/emails/magic-links/notion-magic-link.tsx at line 51:

<comment>`mb-9.5` isn’t part of the Tailwind preset you’re using, so the helper text loses its 38px bottom margin. Use an arbitrary spacing value to keep the layout consistent.</comment>

<file context>
@@ -23,66 +25,54 @@ export const NotionMagicLinkEmail = ({
+          &lt;Text className=&quot;text-[#ababab] text-sm mt-3.5 mb-4&quot;&gt;
+            If you didn&amp;apos;t try to login, you can safely ignore this email.
+          &lt;/Text&gt;
+          &lt;Text className=&quot;text-[#ababab] text-sm mt-3.5 mb-9.5&quot;&gt;
+            Hint: You can set a permanent password in Settings &amp; members → My
+            account.
</file context>
Suggested change
<Text className="text-[#ababab] text-sm mt-3.5 mb-9.5">
<Text className="text-[#ababab] text-sm mt-3.5 mb-[38px]">
Fix with Cubic

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-xs mt-3 mb-6">
<Link
href="https://notion.so"
target="_blank"
className="text-[#898989] text-sm 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',
};
11 changes: 11 additions & 0 deletions apps/demo/emails/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { pixelBasedPreset, type TailwindConfig } from '@react-email/components';

export default {
presets: [pixelBasedPreset],
theme: {
fontFamily: {
notion:
"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif",
},
},
} satisfies TailwindConfig;
10 changes: 5 additions & 5 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"export": "email-dev export"
},
"dependencies": {
"@react-email/components": "workspace:*",
"@react-email/components": "npm:@react-email/[email protected]",
"email-dev": "workspace:*",
"react": "^19",
"react-dom": "^19",
"email-dev": "workspace:*"
"react-dom": "^19"
},
"devDependencies": {
"@react-email/preview-server": "workspace:*",
"next": "^15.3.2",
"@types/react": "^19",
"@types/react-dom": "^19"
"@types/react-dom": "^19",
"next": "^15.3.2"
}
}
Loading
Loading