mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-10 07:48:37 +01:00
18 lines
486 B
TypeScript
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);
|
|
}
|
|
}
|
|
} |