Skip to content

Commit 2e082ae

Browse files
authored
UUID SVG dynamic renderer (#244)
1 parent 249af07 commit 2e082ae

16 files changed

Lines changed: 359 additions & 10 deletions

File tree

.github/workflows/deploy_dev.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
# Deploy the email RPC Service
3232
- name: 🛳️ DEPLOY EMAIL-RPC SERVICE WORKER
3333
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --minify --config ./workers/transactional_email_service/wrangler.toml
34+
# Deploy the svg-renderer
35+
- name: 🛳️ DEPLOY SVG-RENDERER WORKER
36+
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --minify --config ./workers/svg_renderer/wrangler.toml
3437
# Deploy the auth tokens worker
3538
- name: 🛳️ DEPLOY AUTH-TOKEN WORKER
3639
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --minify --config ./workers/auth_tokens/wrangler.toml

.github/workflows/deploy_prod.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
# Deploy the email RPC Service
3535
- name: 🛳️ DEPLOY EMAIL-RPC SERVICE WORKER
3636
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/transactional_email_service/wrangler.toml
37+
# Deploy the svg-renderer
38+
- name: 🛳️ DEPLOY SVG-RENDERER WORKER
39+
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/svg_renderer/wrangler.toml
3740
# Deploy the auth tokens worker
3841
- name: 🛳️ DEPLOY AUTH-TOKEN WORKER
3942
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=production --minify --config ./workers/auth_tokens/wrangler.toml

.github/workflows/deploy_staging.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ jobs:
3434
# Deploy the email RPC Service
3535
- name: 🛳️ DEPLOY EMAIL-RPC SERVICE WORKER
3636
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=staging --minify --config ./workers/transactional_email_service/wrangler.toml
37+
# Deploy the svg-renderer
38+
- name: 🛳️ DEPLOY SVG-RENDERER WORKER
39+
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=staging --minify --config ./workers/svg_renderer/wrangler.toml
3740
# Deploy the auth tokens worker
3841
- name: 🛳️ DEPLOY AUTH-TOKEN WORKER
3942
run: CLOUDFLARE_API_TOKEN=${{ secrets.CLOUDFLARE_WORKERS_JSCONF_DEV_DEPLOY }} npx wrangler deploy --env=staging --minify --config ./workers/auth_tokens/wrangler.toml

emails/templates/helpers/fonts.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ const poppins = [
221221

222222
export const PoppinsFont = () => (
223223
<>
224-
{poppins.map((font) => (
224+
{poppins.map((font, index) => (
225225
<Font
226+
key={index}
226227
fontFamily="Poppins"
227228
fallbackFontFamily="Verdana"
228229
webFont={{

emails/templates/helpers/tickets.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import {
22
Body,
33
Column,
4-
Font,
54
Head,
65
Html,
7-
Link,
8-
Preview,
96
Row,
107
Tailwind,
118
} from "@react-email/components";
@@ -27,8 +24,6 @@ export const TicketTemplate = ({
2724
theme,
2825
font = "poppins",
2926
}: WorkEmailValidationEmailProps & ThemeType) => {
30-
console.log({ font });
31-
3227
return (
3328
<Tailwind
3429
config={{

emails/templates/tickets/event-invitation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const EventInvitation = ({
6868

6969
<Text className="mb-16 text-center">
7070
<Button
71-
href="https://communityos.io/tickets"
71+
href="https://communityos.io/ai-hackathon/tickets"
7272
className="bg-black py-4 px-6 rounded-3xl text-gray-200 self-center"
7373
target="_blank"
7474
>
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import {
2+
Column,
3+
Container,
4+
Hr,
5+
Img,
6+
Link,
7+
Preview,
8+
Row,
9+
Section,
10+
Text,
11+
} from "@react-email/components";
12+
import * as React from "react";
13+
14+
import { BigFooter, TicketTemplate } from "emails/templates/helpers/tickets";
15+
16+
interface EmailProps {
17+
eventName: string;
18+
userTicketId: string;
19+
userName?: string;
20+
eventLogoCloudflareImageURL: string;
21+
userEmail: string;
22+
}
23+
24+
export const TicketConfirmation = ({
25+
eventName,
26+
userTicketId,
27+
userName,
28+
userEmail,
29+
eventLogoCloudflareImageURL,
30+
}: EmailProps) => {
31+
return (
32+
<TicketTemplate theme="light">
33+
<Container className="px-10 py-10 w-full max-w-3xl font-light">
34+
<Section className="">
35+
<Preview>Tu ticket para {eventName}</Preview>
36+
<Row className="h-20 mb-14">
37+
<Column>
38+
<Img
39+
src={`${eventLogoCloudflareImageURL}/w=300,fit=scale-down`}
40+
className="w-full max-w-[200px]"
41+
/>
42+
</Column>
43+
</Row>
44+
45+
<Text className="text-2xl mb-6">
46+
{userName ? `Hola ${userName},` : "Hola,"}
47+
</Text>
48+
49+
<Text className="text-xl mb-8">
50+
Este es tu ticket para el evento:
51+
</Text>
52+
53+
<Text className="text-xl text-center mb-16 px-8 text-gray-400">
54+
{eventName}
55+
</Text>
56+
57+
<Row>
58+
<Img
59+
className="px-20 mb-16"
60+
src={`https://svg-renderer.communityos.io/qr/svg/${userTicketId}`}
61+
/>
62+
</Row>
63+
64+
<Text className="text-xl mb-16">
65+
Recuerda llevar este ticket contigo el día del evento. <br />
66+
También está disponible el tu perfil de CommunityOS, ingresa con tu
67+
correo <span className="font-semibold">{userEmail}</span> en{" "}
68+
<Link href="https://communityos.io/ai-hackathon/tickets">
69+
communityos.io/ai-hackathon/tickets
70+
</Link>
71+
.
72+
</Text>
73+
74+
<Text className="text-xl mb-8">Nos vemos en el evento,</Text>
75+
<Text className="text-xl font-semibold mb-8">Equipo CommunityOS</Text>
76+
77+
<Text className="text-xl mb-8"></Text>
78+
</Section>
79+
<Hr className="my-8 border-black" />
80+
<BigFooter theme="light" />
81+
</Container>
82+
</TicketTemplate>
83+
);
84+
};
85+
86+
TicketConfirmation.PreviewProps = {
87+
eventName: "El Potencial Clave de la Recuperación Aumentada (RAG) con OpenAI",
88+
userName: "John Doe",
89+
userTicketId: "c7fa5dc0-ffa2-4369-bac7-3aa52d7cc640",
90+
eventLogoCloudflareImageURL:
91+
"https://imagedelivery.net/dqFoxiedZNoncKJ9uqxz0g/6cdd148e-b931-4b7a-f983-d75d388aff00",
92+
userEmail: "fake@email.com",
93+
} satisfies EmailProps;
94+
95+
export default TicketConfirmation;

emails/templates/tickets/waitlist-accepted.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const WaitlistAccepted = ({
6868

6969
<Text className="mb-8 text-center">
7070
<Button
71-
href="https://communityos.io/tickets"
71+
href="https://communityos.io/ai-hackathon/tickets"
7272
className="bg-black py-4 px-6 rounded-3xl text-gray-200 self-center"
7373
target="_blank"
7474
>

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"prettier:fix": "prettier ./src --cache --write",
2020
"typecheck": "tsc",
2121
"dev": "wrangler dev --log-level info",
22+
"dev:svg-renderer": "wrangler dev --test-scheduled --config ./workers/svg_renderer/wrangler.toml",
2223
"dev:wall-of-fame": "wrangler dev --test-scheduled --config ./workers/wall_of_fame_cron/wrangler.toml",
2324
"dev:sanity": "wrangler dev --test-scheduled --config ./workers/sanity_asset_importer/wrangler.toml",
2425
"dev:auth": "wrangler dev --test-scheduled --config ./workers/auth_tokens/wrangler.toml",
@@ -102,6 +103,7 @@
102103
"mercadopago": "^2.0.9",
103104
"p-map": "^6.0.0",
104105
"postgres": "^3.4.4",
106+
"qr-svg": "^1.1.0",
105107
"react": "^18.2.0",
106108
"resend": "^3.3.0",
107109
"slugify": "^1.6.6",

0 commit comments

Comments
 (0)