forked from CaliCastle/cali.so
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
233a492
commit 9740a1e
Showing
9 changed files
with
1,414 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,3 +43,5 @@ next-env.d.ts | |
.turbo | ||
|
||
static/ | ||
|
||
.react-email/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export { Body } from '@react-email/body' | ||
export { Button } from '@react-email/button' | ||
export { Container } from '@react-email/container' | ||
export { Head } from '@react-email/head' | ||
export { Heading } from '@react-email/heading' | ||
export { Hr } from '@react-email/hr' | ||
export { Html } from '@react-email/html' | ||
export { Img } from '@react-email/img' | ||
export { Link } from '@react-email/link' | ||
export { Preview } from '@react-email/preview' | ||
export { Row } from '@react-email/row' | ||
export { Section } from '@react-email/section' | ||
export { Tailwind } from '@react-email/tailwind' | ||
export { Text } from '@react-email/text' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import * as React from 'react' | ||
|
||
import { | ||
Body, | ||
Button, | ||
Container, | ||
Head, | ||
Heading, | ||
Hr, | ||
Html, | ||
Img, | ||
Link, | ||
Preview, | ||
Section, | ||
Tailwind, | ||
Text, | ||
} from './_components' | ||
|
||
const baseUrl = | ||
process.env.VERCEL_ENV === 'production' | ||
? `https://cali.so` | ||
: 'http://localhost:3000' | ||
const confirmLink = new URL('/confirm', baseUrl) | ||
|
||
const ConfirmSubscriptionEmail: React.FC<{ | ||
token?: string | ||
}> = ({ token = 'fake-token' }) => { | ||
const previewText = `确认订阅 Cali 的动态吗?` | ||
confirmLink.searchParams.set('token', token) | ||
const link = confirmLink.toString() | ||
|
||
return ( | ||
<Html> | ||
<Head /> | ||
<Preview>{previewText}</Preview> | ||
<Tailwind> | ||
<Body className="mx-auto my-auto mt-[32px] bg-zinc-50 font-sans"> | ||
<Container className="mx-auto my-[40px] w-[465px] rounded-2xl border border-solid border-zinc-100 bg-white p-[20px]"> | ||
<Section className="mt-[24px]"> | ||
<Img | ||
src={`${baseUrl}/subscription-email-header.jpg`} | ||
width="234" | ||
height="121" | ||
alt="Cali" | ||
className="mx-auto my-0" | ||
/> | ||
</Section> | ||
<Heading className="mx-0 my-[30px] p-0 text-center text-[24px] font-bold text-black"> | ||
订阅 Cali 的动态 | ||
</Heading> | ||
<Text className="text-[14px] leading-[24px] text-black"> | ||
Hello! | ||
</Text> | ||
<Text className="text-[14px] leading-[24px] text-black"> | ||
为了认证此操作,请点击下面的按钮确认订阅 Cali 的动态噢,谢谢 🙏 | ||
</Text> | ||
<Section className="mb-[32px] mt-[32px] text-center"> | ||
<Button | ||
pX={20} | ||
pY={12} | ||
className="rounded-xl bg-zinc-900 text-center text-[12px] font-semibold text-white no-underline" | ||
href={link} | ||
> | ||
确认订阅 | ||
</Button> | ||
</Section> | ||
<Text className="text-[14px] leading-[24px] text-black"> | ||
或者复制下面的链接到你的浏览器中进行访问:{' '} | ||
<Link href={link} className="text-blue-600 no-underline"> | ||
{link} | ||
</Link> | ||
</Text> | ||
<Hr className="mx-0 my-[26px] w-full border border-solid border-[#eaeaea]" /> | ||
<Text className="text-[12px] leading-[24px] text-[#666666]"> | ||
如果不是你本人操作的可以无视本封邮件,如果你有任何疑问可以随时联系我。 | ||
</Text> | ||
</Container> | ||
|
||
<Container className="mx-auto mt-[32px] w-[465px]"> | ||
<Hr className="mx-0 my-[20px] h-px w-full bg-zinc-100" /> | ||
<Section> | ||
<Img | ||
src={`${baseUrl}/icon.png`} | ||
width="24" | ||
height="24" | ||
alt="Cali" | ||
className="mx-auto my-0" | ||
/> | ||
<Text className="text-center"> | ||
<Link | ||
href="https://cali.so" | ||
className="text-zinc-700 underline" | ||
> | ||
<strong>Cali Castle</strong> | ||
</Link> | ||
<br /> | ||
开发者、设计师、细节控、创始人 | ||
</Text> | ||
</Section> | ||
</Container> | ||
</Body> | ||
</Tailwind> | ||
</Html> | ||
) | ||
} | ||
|
||
export default ConfirmSubscriptionEmail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Button } from '@react-email/button' | ||
import { Html } from '@react-email/html' | ||
import * as React from 'react' | ||
|
||
export default function Email() { | ||
return ( | ||
<Html> | ||
<Button | ||
pX={20} | ||
pY={12} | ||
href="https://example.com" | ||
style={{ background: '#000', color: '#fff' }} | ||
> | ||
Click me | ||
</Button> | ||
</Html> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.