Files
litlyx/dashboard/server/services/EmailServiceHelper.ts
2025-01-29 16:03:01 +01:00

18 lines
486 B
TypeScript

import { EmailServerInfo } from '@services/EmailService'
const { EMAIL_SECRET } = useRuntimeConfig();
export class EmailServiceHelper {
static async sendEmail(data: EmailServerInfo) {
try {
await $fetch(data.url, {
method: 'POST',
body: JSON.stringify(data.body),
headers: { ...data.headers, 'x-litlyx-token': EMAIL_SECRET }
})
} catch (ex) {
console.error(ex);
}
}
}