Resolve build errors
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
*
|
||||
*/
|
||||
import { Resend } from 'resend';
|
||||
import { RESEND_API_KEY, EMAIL_FROM, RESEND_TEMPLATE_ID } from '$env/static/private';
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
export const resend = new Resend(RESEND_API_KEY);
|
||||
export const resend = new Resend(env.RESEND_API_KEY);
|
||||
|
||||
/**
|
||||
* Send a transactional email using a Resend-hosted template.
|
||||
@@ -39,11 +39,11 @@ export async function sendMail(options: {
|
||||
const { to, subject, templateId, data } = options;
|
||||
|
||||
const result = await resend.emails.send({
|
||||
from: EMAIL_FROM,
|
||||
from: env.EMAIL_FROM,
|
||||
to: [to],
|
||||
subject: subject ?? 'Template Email',
|
||||
template: {
|
||||
id: templateId ?? RESEND_TEMPLATE_ID,
|
||||
id: templateId ?? env.RESEND_TEMPLATE_ID,
|
||||
variables: data ?? {}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user