Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
906 B ยท 34 lines
TypeScript
at incident-api
1234567891011121314151617181920212223242526272829303132333435import { EmailClient } from "@openstatus/emails";import Resend from "next-auth/providers/resend";
import { getValidCustomDomain } from "../domain";import { getQueryClient, trpc } from "../trpc/server";
export const ResendProvider = Resend({ apiKey: undefined, async sendVerificationRequest(params) { const url = params.url; const email = params.identifier;
const emailClient = new EmailClient({ apiKey: process.env.RESEND_API_KEY ?? "", });
const { prefix } = getValidCustomDomain(params.request);
if (!prefix) return;
const queryClient = getQueryClient(); const query = await queryClient.fetchQuery( trpc.statusPage.validateEmailDomain.queryOptions({ slug: prefix, email }), );
if (!query) return;
await emailClient.sendStatusPageMagicLink({ page: query.page.title, link: url, to: params.identifier, }); },});