Skip to content

Commit

Permalink
had to change to canary version of react-email projects because of a …
Browse files Browse the repository at this point in the history
  • Loading branch information
everybodyloveshaggis committed Apr 11, 2024
1 parent 56935a5 commit 9cd8892
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 26 deletions.
1 change: 0 additions & 1 deletion api/sendEmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const sendEmail = async (formData: FormData) => {
// text: senderMessage as string,
react: React.createElement(ContactFormEmail,
{
//assertion needed here as we know for sure this will be correct, due to validation we are preforming on frontend and API
senderMessage: senderMessage as string,
senderEmail: senderEmail as string
}
Expand Down
40 changes: 20 additions & 20 deletions email/contact-form-email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ type ContactFormEmailProps = {
};

export default function ContactFormEmail({ senderMessage, senderEmail }: ContactFormEmailProps) {
console.log(<Heading as='h2'>
You received the following message from the contact form
</Heading>);
console.log(<Text>{senderMessage}</Text>);
return (<Html lang='en'>
var responsehtml =(
<Html>
<Head />
<Preview>New Message From Your Portfolio</Preview>
<Preview>New message from your portfolio site</Preview>
<Tailwind>
<Body>
<Container>
<Section>
<Heading as='h2'>
You received the following message from the contact form
</Heading>
<Text>{senderMessage}</Text>
<Hr />
<Text>The sender's email is {senderEmail}</Text>
</Section>
</Container>
</Body>
<Body className="bg-gray-100 text-black">
<Container>
<Section className="bg-white borderBlack my-10 px-10 py-4 rounded-md">
<Heading className="leading-tight">
You received the following message from the contact form
</Heading>
<Text>{senderMessage}</Text>
<Hr />
<Text>The sender's email is: {senderEmail}</Text>
</Section>
</Container>
</Body>
</Tailwind>
</Html>
)
</Html>
);

console.log(responsehtml);
return responsehtml;
}
22 changes: 18 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@react-email/components": "^0.0.16",
"@react-email/tailwind": "^0.0.15",
"@react-email/tailwind": "^0.0.16-canary.1",
"clsx": "^2.1.0",
"framer-motion": "^10.16.5",
"next": "14.0.3",
Expand Down

0 comments on commit 9cd8892

Please sign in to comment.