File tree Expand file tree Collapse file tree
src/routes/api/send-demo-email Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { json } from '@sveltejs/kit' ;
22import { render } from 'svelte/server' ;
33import { Resend } from 'resend' ;
4- import { RESEND_API_KEY , FROM_EMAIL } from '$env/static /private' ;
4+ import { env } from '$env/dynamic /private' ;
55import 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
99export 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
You can’t perform that action at this time.
0 commit comments