Merge pull request #19 from atridadl/dev

1.2.1
 Emails look MUCH prettier!
This commit is contained in:
Atridad Lahiji 2023-06-25 16:56:40 -06:00 committed by GitHub
commit c7753b254b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 70 additions and 55 deletions

View file

@ -2,8 +2,10 @@
DATABASE_URL="" DATABASE_URL=""
# Redis # Redis
REDIS_URL="" UPSTASH_REDIS_REST_URL=""
REDIS_TTL="" UPSTASH_REDIS_REST_TOKEN=""
UPSTASH_RATELIMIT_REQUESTS=""
UPSTASH_RATELIMIT_SECONDS=""
#Next Auth Core #Next Auth Core
NEXTAUTH_SECRET="" NEXTAUTH_SECRET=""

View file

@ -1,6 +1,6 @@
{ {
"name": "sprintpadawan", "name": "sprintpadawan",
"version": "1.2.0", "version": "1.2.1",
"description": "Plan. Sprint. Repeat.", "description": "Plan. Sprint. Repeat.",
"private": true, "private": true,
"scripts": { "scripts": {

View file

@ -1,6 +1,3 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
enum RoleValue { enum RoleValue {
USER USER
ADMIN ADMIN

View file

@ -8,27 +8,42 @@ import {
Preview, Preview,
Text, Text,
Hr, Hr,
Tailwind,
Section,
Img,
} from "@react-email/components"; } from "@react-email/components";
import { env } from "~/env.mjs";
interface EmailTemplateProps { interface GoodbyeTemplateProps {
name: string; name: string;
} }
export const Goodbye: React.FC<Readonly<EmailTemplateProps>> = ({ name }) => ( export const Goodbye: React.FC<Readonly<GoodbyeTemplateProps>> = ({ name }) => (
<Html> <Html>
<Head /> <Head />
<Preview>Sorry to see you go... 😭</Preview> <Preview>Sorry to see you go... 😭</Preview>
<Body> <Tailwind>
<Container> <Body className="bg-white my-auto mx-auto font-sans">
<Heading className="text-4xl">Farewell, {name}...</Heading> <Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] w-[465px]">
<Text>{"Were sorry to see you go."}</Text> <Section className="mt-[32px]">
<Text> <Img
Your data has been deleted, including all room history, user data, src={`${env.NEXTAUTH_URL}/logo.webp`}
votes, etc. width="40"
</Text> height="37"
<Hr /> alt={`Sprint Padawan Logo`}
<Text>Sprint Padawan Admin - Atridad</Text> className="my-0 mx-auto"
</Container> />
</Body> </Section>
<Heading className="text-4xl">Farewell, {name}...</Heading>
<Text>{"Were sorry to see you go."}</Text>
<Text>
Your data has been deleted, including all room history, user data,
votes, etc.
</Text>
<Hr className="border border-solid border-[#eaeaea] my-[26px] mx-0 w-full" />
<Text> The Sprint Padawan team</Text>
</Container>
</Body>
</Tailwind>
</Html> </Html>
); );

View file

@ -8,27 +8,47 @@ import {
Preview, Preview,
Text, Text,
Hr, Hr,
Tailwind,
Section,
Img,
} from "@react-email/components"; } from "@react-email/components";
import { env } from "~/env.mjs";
interface EmailTemplateProps { interface WelcomeTemplateProps {
name: string; name: string;
} }
export const Welcome: React.FC<Readonly<EmailTemplateProps>> = ({ name }) => ( export const Welcome: React.FC<Readonly<WelcomeTemplateProps>> = ({ name }) => (
<Html> <Html>
<Head /> <Head />
<Preview>🎉 Welcome to Sprint Padawan! 🎉</Preview> <Preview>🎉 Welcome to Sprint Padawan! 🎉</Preview>
<Body> <Tailwind>
<Container> <Body className="bg-white my-auto mx-auto font-sans">
<Heading className="text-4xl">Welcome, {name}!</Heading> <Container className="border border-solid border-[#eaeaea] rounded my-[40px] mx-auto p-[20px] w-[465px]">
<Text>Thank you for signing up for Sprint Padawan!</Text> <Section className="mt-[32px]">
<Text> <Img
If at any point you encounter issues, please let me know at src={`${env.NEXTAUTH_URL}/logo.webp`}
support@sprintpadawan.dev. width="40"
</Text> height="37"
<Hr /> alt={`Sprint Padawan Logo`}
<Text>Sprint Padawan Admin - Atridad</Text> className="my-0 mx-auto"
</Container> />
</Body> </Section>
<Heading className="text-black text-[24px] font-normal text-center p-0 my-[30px] mx-0">
🎉 Welcome to Sprint Padawan, <strong>{name}</strong>! 🎉
</Heading>
<Text className="text-black text-[14px] leading-[24px]">
Hello {name},
</Text>
<Text>Thank you for signing up for Sprint Padawan!</Text>
<Text>
If at any point you encounter issues, please let me know at
support@sprintpadawan.dev.
</Text>
<Hr className="border border-solid border-[#eaeaea] my-[26px] mx-0 w-full" />
<Text> The Sprint Padawan team</Text>
</Container>
</Body>
</Tailwind>
</Html> </Html>
); );

View file

@ -22,27 +22,8 @@ const server = z.object({
// VERCEL_URL doesn't include `https` so it cant be validated as a URL // VERCEL_URL doesn't include `https` so it cant be validated as a URL
process.env.VERCEL ? z.string().min(1) : z.string().url() process.env.VERCEL ? z.string().min(1) : z.string().url()
), ),
// Add `.min(1) on ID and SECRET if you want to make sure they're not empty GITHUB_CLIENT_ID: z.string(),
GITHUB_CLIENT_ID: z.preprocess( GITHUB_CLIENT_SECRET: z.string(),
// This makes Vercel deployments not fail if you don't set NEXTAUTH_URL
// Since NextAuth.js automatically uses the VERCEL_URL if present.
(str) =>
process.env.NODE_ENV === "development"
? process.env.GITHUB_CLIENT_ID_LOCAL
: process.env.GITHUB_CLIENT_ID,
// VERCEL_URL doesn't include `https` so it cant be validated as a URL
z.string()
),
GITHUB_CLIENT_SECRET: z.preprocess(
// This makes Vercel deployments not fail if you don't set NEXTAUTH_URL
// Since NextAuth.js automatically uses the VERCEL_URL if present.
(str) =>
process.env.NODE_ENV === "development"
? process.env.GITHUB_CLIENT_SECRET_LOCAL
: process.env.GITHUB_CLIENT_SECRET,
// VERCEL_URL doesn't include `https` so it cant be validated as a URL
z.string()
),
GOOGLE_CLIENT_ID: z.string(), GOOGLE_CLIENT_ID: z.string(),
GOOGLE_CLIENT_SECRET: z.string(), GOOGLE_CLIENT_SECRET: z.string(),
ABLY_PRIVATE_KEY: z.string(), ABLY_PRIVATE_KEY: z.string(),