Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
88 changes: 88 additions & 0 deletions content-samples/react/emails/emailExample/emailExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import {
Body,
Container,
Head,
Html,
Text,
Img,
Link,
} from "@react-email/components";
import * as React from "react";

interface VisualEmailNotificationProps {
validationCode?: string;
}

export const VisualEmailNotification = ({
validationCode,
}: VisualEmailNotificationProps) => (
<Html>
<Head />
<Body style={main}>
<Container style={container}>
<Img
src="https://user-images.githubusercontent.com/2233092/213641043-3bbb3f21-3c53-4e67-afe5-755aeb222159.png"
alt="Company Logo"
style={logoStyle}
/>
<Img
src="https://mlid.fr/shop/42-thickbox_default/email-creation.jpg"
alt="Email Notification"
style={imageStyle}
/>
<Text style={messageStyle}>
You've received an important notification.
</Text>
<Link href="https://example.com/inbox" style={buttonStyle}>
Open Email
</Link>
</Container>
</Body>
</Html>
);

export default VisualEmailNotification;

const main = {
backgroundColor: "#f0f0f0",
fontFamily: "Arial, sans-serif",
padding: "20px",
textAlign: "center" as "center",
};

const container = {
backgroundColor: "#ffffff",
borderRadius: "8px",
padding: "20px",
maxWidth: "700px",
height: "auto",
margin: "0 auto",
boxShadow: "0px 4px 12px rgba(0, 0, 0, 0.1)",
};

const logoStyle = {
maxWidth: "100px",
marginBottom: "20px",
};

const imageStyle = {
maxWidth: "200px",
marginBottom: "20px",
margin: "auto",
};

const messageStyle = {
fontSize: "18px",
color: "#333333",
marginBottom: "20px",
};

const buttonStyle = {
display: "inline-block",
background: "linear-gradient(to right, rgb(0, 99, 169), rgb(3, 58, 98))",
color: "#ffffff",
padding: "10px 20px",
borderRadius: "5px",
textDecoration: "none",
fontSize: "16px",
};
4 changes: 2 additions & 2 deletions content-samples/react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.