Skip to content

Commit 01a1d20

Browse files
committed
fix: use dynamic env instead of static ones on workflow build
1 parent aa76e0c commit 01a1d20

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/routes/api/send-demo-email/+server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { json } from '@sveltejs/kit';
22
import { render } from 'svelte/server';
33
import { Resend } from 'resend';
4-
import { RESEND_API_KEY, FROM_EMAIL } from '$env/static/private';
4+
import { env } from '$env/dynamic/private';
55
import DemoEmail from '$lib/emails/demo-email.svelte';
66

7-
const resend = new Resend(RESEND_API_KEY);
7+
const resend = new Resend(env.RESEND_API_KEY);
88

99
export async function POST({ request }) {
1010
try {
@@ -26,7 +26,7 @@ export async function POST({ request }) {
2626

2727
// Send email using Resend
2828
const { data, error } = await resend.emails.send({
29-
from: FROM_EMAIL || 'onboarding@resend.dev',
29+
from: env.FROM_EMAIL || 'onboarding@resend.dev',
3030
to: email,
3131
subject: '✨ better-svelte-email Demo - It Works!',
3232
html: result.body

0 commit comments

Comments
 (0)