110 lines
2.8 KiB
TypeScript
110 lines
2.8 KiB
TypeScript
import { siteConfig } from "@/config/site";
|
|
import { getBaseUrl } from "@/lib/utils";
|
|
import {
|
|
Body,
|
|
Button,
|
|
Container,
|
|
Head,
|
|
Hr,
|
|
Html,
|
|
Img,
|
|
Link,
|
|
Preview,
|
|
Section,
|
|
Text,
|
|
} from "@react-email/components";
|
|
import {
|
|
anchor,
|
|
box,
|
|
button,
|
|
container,
|
|
footer,
|
|
footerLeft,
|
|
footerRight,
|
|
hr,
|
|
main,
|
|
paragraph,
|
|
} from "./email-formats";
|
|
|
|
interface ResetPasswordEmailProps {
|
|
userName?: string;
|
|
resetLink?: string;
|
|
}
|
|
|
|
/**
|
|
* https://demo.react.email/preview/welcome/stripe-welcome
|
|
*/
|
|
export const ResetPasswordEmail = ({
|
|
userName,
|
|
resetLink,
|
|
}: ResetPasswordEmailProps) => {
|
|
const baseUrl = getBaseUrl();
|
|
return (
|
|
<Html>
|
|
<Head />
|
|
<Preview>Reset your password</Preview>
|
|
<Body style={main}>
|
|
<Container style={container}>
|
|
<Section style={box}>
|
|
<Img
|
|
src={`${baseUrl}/logo.png`}
|
|
width="32"
|
|
height="32"
|
|
alt="Logo"
|
|
/>
|
|
<Hr style={hr} />
|
|
<Text style={paragraph}>Hi {userName},</Text>
|
|
<Text style={paragraph}>
|
|
Someone recently requested a password change for your account. If
|
|
this was you, you can set a new password here:
|
|
</Text>
|
|
<Button style={button} href={resetLink}>
|
|
Reset password
|
|
</Button>
|
|
<Hr style={hr} />
|
|
<Text style={paragraph}>
|
|
If you don't want to change your password or didn't
|
|
request this, just ignore and delete this message.
|
|
</Text>
|
|
<Text style={paragraph}>
|
|
To keep your account secure, please don't forward this email
|
|
to anyone.
|
|
</Text>
|
|
<Text style={paragraph}>
|
|
Thanks, <br />
|
|
The{" "}
|
|
<Link style={anchor} href={baseUrl}>
|
|
{siteConfig.name}
|
|
</Link>{" "}
|
|
team
|
|
</Text>
|
|
<Hr style={hr} />
|
|
<Text style={footer}>
|
|
<span style={footerLeft}>
|
|
© {new Date().getFullYear()}
|
|
All Rights Reserved.
|
|
</span>
|
|
<span style={footerRight}>
|
|
<Link style={anchor} href={siteConfig.links.twitter}>
|
|
Twitter
|
|
</Link>
|
|
|
|
<Link style={anchor} href={siteConfig.links.github}>
|
|
GitHub
|
|
</Link>
|
|
</span>
|
|
</Text>
|
|
</Section>
|
|
</Container>
|
|
</Body>
|
|
</Html>
|
|
);
|
|
};
|
|
|
|
ResetPasswordEmail.PreviewProps = {
|
|
userName: "Javayhu",
|
|
resetLink: "https://demo.mkdirs.com",
|
|
} as ResetPasswordEmailProps;
|
|
|
|
export default ResetPasswordEmail;
|