Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🔥 Delete unused api route

Luke Vella679d73ba8a55
diff --git a/apps/web/src/app/api/send-email/route.ts b/apps/web/src/app/api/send-email/route.ts
deleted file mode 100644
index 6f02c48d4..000000000
--- a/apps/web/src/app/api/send-email/route.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import * as Sentry from "@sentry/nextjs";
-import { verifySignatureAppRouter } from "@upstash/qstash/dist/nextjs";
-import type { NextRequest } from "next/server";
-import { NextResponse } from "next/server";
-
-import { getEmailClient } from "@/utils/emails";
-
-export const POST = async (req: NextRequest) => {
- /**
- * We need to call verifySignatureAppRouter inside the route handler
- * to avoid the build breaking when env vars are not set.
- */
- return verifySignatureAppRouter(async (req: Request) => {
- const body = await req.json();
-
- // TODO: Add validation for templateName and options
-
- const emailClient = await getEmailClient(body.locale);
-
- try {
- await emailClient.sendTemplate(body.templateName, body.options);
-
- return NextResponse.json({ success: true });
- } catch (error) {
- Sentry.captureException(error);
-
- return NextResponse.json(
- { success: false, error: "Failed to send email" },
- { status: 500 },
- );
- }
- })(req);
-};