top level env var
This commit is contained in:
@@ -4,6 +4,7 @@ import { sendEmail } from '@/lib/email';
|
|||||||
import general from '@/content/settings/general.json';
|
import general from '@/content/settings/general.json';
|
||||||
|
|
||||||
export const prerender = false;
|
export const prerender = false;
|
||||||
|
const apiKey = (env as any).RESEND_API_KEY;
|
||||||
|
|
||||||
interface ContactBody {
|
interface ContactBody {
|
||||||
fullName: string;
|
fullName: string;
|
||||||
@@ -89,7 +90,6 @@ export const POST: APIRoute = async ({ request }) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiKey = (env as unknown as Record<string, string>).RESEND_API_KEY;
|
|
||||||
const toAddress = general.emailToContact?.trim();
|
const toAddress = general.emailToContact?.trim();
|
||||||
const fromAddress = general.emailFromContact?.trim();
|
const fromAddress = general.emailFromContact?.trim();
|
||||||
if (!apiKey || !toAddress || !fromAddress) {
|
if (!apiKey || !toAddress || !fromAddress) {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { sendEmail } from '@/lib/email';
|
|||||||
import general from '@/content/settings/general.json';
|
import general from '@/content/settings/general.json';
|
||||||
|
|
||||||
export const prerender = false;
|
export const prerender = false;
|
||||||
|
const apiKey = (env as any).RESEND_API_KEY;
|
||||||
|
|
||||||
const MAX_TOTAL_BYTES = 20 * 1024 * 1024;
|
const MAX_TOTAL_BYTES = 20 * 1024 * 1024;
|
||||||
|
|
||||||
@@ -214,7 +215,6 @@ export const POST: APIRoute = async ({ request }) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const apiKey = (env as unknown as Record<string, string>).RESEND_API_KEY;
|
|
||||||
const fromAddress = general.fromAddressSubmission?.trim();
|
const fromAddress = general.fromAddressSubmission?.trim();
|
||||||
const toAddress = general.toAddressSubmission?.trim();
|
const toAddress = general.toAddressSubmission?.trim();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user