mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-09 23:48:36 +01:00
19 lines
506 B
TypeScript
19 lines
506 B
TypeScript
|
|
import { EmailServerInfo } from './shared/services/EmailService'
|
|
import axios from 'axios';
|
|
|
|
const EMAIL_SECRET = process.env.EMAIL_SECRET;
|
|
|
|
export class EmailServiceHelper {
|
|
static async sendEmail(data: EmailServerInfo) {
|
|
try {
|
|
await axios(data.url, {
|
|
method: 'POST',
|
|
data: data.body,
|
|
headers: { ...data.headers, 'x-litlyx-token': EMAIL_SECRET }
|
|
})
|
|
} catch (ex) {
|
|
console.error(ex);
|
|
}
|
|
}
|
|
} |