chore: email path fix for deployed server

This commit is contained in:
Charlie Lamb
2026-01-28 13:05:03 +00:00
parent af997e8322
commit 41e2f2826c
4 changed files with 91 additions and 94 deletions

View File

@@ -1,57 +0,0 @@
import * as React from "react";
import {
Html,
Head,
Body,
Container,
Section,
Text,
Heading,
Tailwind,
} from "@react-email/components";
const OTPEmail = (props: { otpCode: string }) => {
return (
<Html lang="en" dir="ltr">
<Tailwind>
<Head />
<Body className="bg-white font-sans">
<Container className="bg-white max-w-[600px] mx-auto px-[40px] py-[40px]">
<Heading className="text-gray-900 text-[24px] font-bold mb-[24px]">
Verification code
</Heading>
<Text className="text-gray-800 text-[16px] leading-[24px] mb-[24px]">
Enter the following verification code when prompted:
</Text>
<Text className="text-[32px] font-bold text-gray-900 font-mono mb-[24px]">
{props.otpCode}
</Text>
<Text className="text-gray-800 text-[16px] leading-[24px] mb-[40px]">
To protect your account, do not share this code.
</Text>
{/* Footer */}
<Section className="border-t border-gray-200 pt-[24px]">
<Text className="text-gray-500 text-[12px] leading-[16px] m-0">
Autumn
<br />
2261 Market Street STE 22390
<br />
San Francisco, CA, US, 94114
</Text>
</Section>
</Container>
</Body>
</Tailwind>
</Html>
);
};
OTPEmail.PreviewProps = {
otpCode: "884085",
};
export default OTPEmail;

View File

@@ -0,0 +1,56 @@
import {
Body,
Container,
Head,
Heading,
Html,
Section,
Tailwind,
Text,
} from "@react-email/components";
const OTPEmail = (props: { otpCode: string }) => {
return (
<Html lang="en" dir="ltr">
<Tailwind>
<Head />
<Body className="bg-white font-sans">
<Container className="bg-white max-w-[600px] mx-auto px-[40px] py-[40px]">
<Heading className="text-gray-900 text-[24px] font-bold mb-[24px]">
Verification code
</Heading>
<Text className="text-gray-800 text-[16px] leading-[24px] mb-[24px]">
Enter the following verification code when prompted:
</Text>
<Text className="text-[32px] font-bold text-gray-900 font-mono mb-[24px]">
{props.otpCode}
</Text>
<Text className="text-gray-800 text-[16px] leading-[24px] mb-[40px]">
To protect your account, do not share this code.
</Text>
{/* Footer */}
<Section className="border-t border-gray-200 pt-[24px]">
<Text className="text-gray-500 text-[12px] leading-[16px] m-0">
Autumn
<br />
2261 Market Street STE 22390
<br />
San Francisco, CA, US, 94114
</Text>
</Section>
</Container>
</Body>
</Tailwind>
</Html>
);
};
OTPEmail.PreviewProps = {
otpCode: "884085",
};
export default OTPEmail;

View File

@@ -1,7 +1,7 @@
import OTPEmail from "@emails/otpemail.js";
import { logger } from "@/external/logtail/logtailUtils.js";
import { createResendCli } from "@/external/resend/resendUtils.js";
import { FROM_AUTUMN } from "./constants.js";
import OTPEmail from "./OTPEmail.js";
const sendOTPEmail = async ({ email, otp }: { email: string; otp: string }) => {
if (!process.env.RESEND_API_KEY || !process.env.RESEND_DOMAIN) {

View File

@@ -1,40 +1,38 @@
{
"ts-node": {
"esm": true,
"experimentalSpecifier": true
},
"compilerOptions": {
"target": "ES2020",
"moduleResolution": "bundler",
"module": "Preserve",
"ts-node": {
"esm": true,
"experimentalSpecifier": true
},
"compilerOptions": {
"target": "ES2020",
"moduleResolution": "bundler",
"module": "Preserve",
// "declaration": true,
"jsx": "react-jsx",
"rootDir": ".",
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["./src/*"],
"@server/*": ["./src/*"],
"@shared/*": ["../shared/*"],
"@emails/*": ["./emails/*"],
"@scripts/*": ["./scripts/*"],
"@lua/*": ["./src/_luaScripts/*"],
"@tests/*": ["./tests/*"],
// "declaration": true,
"jsx": "react-jsx",
"rootDir": ".",
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["./src/*"],
"@server/*": ["./src/*"],
"@shared/*": ["../shared/*"],
"@scripts/*": ["./scripts/*"],
"@lua/*": ["./src/_luaScripts/*"],
"@tests/*": ["./tests/*"],
// From shared package?
"@autumn/shared": ["../shared/index.ts"],
"@autumn/shared/*": ["../shared/*"],
"@api/*": ["../shared/api/*"],
"@models/*": ["../shared/models/*"],
"@utils/*": ["../shared/utils/*"],
}
},
"include": ["src", "tests", "scripts", "emails", "experiments"],
"exclude": ["node_modules", "dist", "tests/archives"]
// From shared package?
"@autumn/shared": ["../shared/index.ts"],
"@autumn/shared/*": ["../shared/*"],
"@api/*": ["../shared/api/*"],
"@models/*": ["../shared/models/*"],
"@utils/*": ["../shared/utils/*"]
}
},
"include": ["src", "tests", "scripts", "experiments"],
"exclude": ["node_modules", "dist", "tests/archives"]
}