Skip to content

Commit 0a9f06f

Browse files
committed
feat: add email blog section
1 parent 4662e26 commit 0a9f06f

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Column, Img, Link, Row, Section, Text } from "@react-email/components";
2+
3+
const baseUrl = "https://www.crocoder.dev";
4+
5+
const Blog = ({
6+
blogLinks = [],
7+
description,
8+
}: {
9+
blogLinks: Array<{ path: string; title: string; imageUrl: string }>;
10+
description: string;
11+
}) => {
12+
return (
13+
<Section className="pt-2">
14+
<Row>
15+
<Column>
16+
<Text>{description}</Text>
17+
</Column>
18+
</Row>
19+
<Row className="table-fixed">
20+
{blogLinks.map(({ path, title, imageUrl }) => {
21+
return (
22+
<Column className="pr-4 align-top">
23+
<Link href={`${baseUrl}/blog/${path}`} className=" h-full">
24+
<Img
25+
src={`${baseUrl}/${imageUrl}`}
26+
width={"100%"}
27+
height={120}
28+
className="rounded-md object-cover aspect-video"
29+
/>
30+
<Text className="text-neutral-700 font-bold">{title}</Text>
31+
</Link>
32+
</Column>
33+
);
34+
})}
35+
</Row>
36+
</Section>
37+
);
38+
};
39+
export default Blog;

apps/contact/email-templates/contact.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Text, Section } from "@react-email/components";
1+
import { Hr, Section, Text } from "@react-email/components";
2+
import Blog from "./components/Blog";
23
import Layout from "./components/Layout";
34

45
const ContactTemplate = () => {
@@ -24,6 +25,30 @@ const ContactTemplate = () => {
2425
Best regards, <br />
2526
The CroCoder team
2627
</Text>
28+
<Hr />
29+
<Blog
30+
description="While waiting for an answer look at how we helped other teams"
31+
blogLinks={[
32+
{
33+
path: "migrating-an-enterprise-app-from-angularjs-to-react",
34+
imageUrl: "/images/from-angular-to-react.png",
35+
title: "Migrating an Enterprise App from AngularJS to React",
36+
},
37+
{
38+
path: "how-we-rebuilt-a-legacy-ui-with-zero-downtime",
39+
imageUrl:
40+
"/images/how-we-rebuilt-a-legacy-ui-with-zero-downtime.png",
41+
title:
42+
"How We Rebuilt a Legacy UI With Zero Downtime: A Case Study in Component Libraries and Frontend Guidance",
43+
},
44+
{
45+
path: "using-lago-to-create-a-flexible-billing-system",
46+
imageUrl:
47+
"/images/using-lago-to-create-a-flexible-billing-system-2.png",
48+
title: "Using Lago to Create a Flexible Billing System",
49+
},
50+
]}
51+
/>
2752
</Section>
2853
</Layout>
2954
);

0 commit comments

Comments
 (0)