Files
speckle-server/packages/server/modules/emails/index.ts
T
Kristaps Fabians Geikins 4b06f42db7 chore(server): run TS files directly (no compilation) (#5134)
* sort of works

* type fixes

* added option to run old way too
2025-07-23 11:20:40 +02:00

43 lines
934 B
TypeScript

/* istanbul ignore file */
import { moduleLogger } from '@/observability/logging'
import * as SendingService from '@/modules/emails/services/sending'
import { initializeTransporter } from '@/modules/emails/utils/transporter'
import type { SpeckleModule } from '@/modules/shared/helpers/typeHelper'
import RestApi from '@/modules/emails/rest/index'
const emailsModule: SpeckleModule = {
init: async ({ app }) => {
moduleLogger.info('📧 Init emails module')
// init transporter
await initializeTransporter()
// init rest api
RestApi(app)
}
}
/**
* @deprecated Use `sendEmail` from `@/modules/emails/services/sending` instead
*/
async function sendEmail({
from,
to,
subject,
text,
html
}: {
from?: string
to: string
subject: string
text: string
html: string
}) {
return SendingService.sendEmail({ from, to, subject, text, html })
}
export default {
...emailsModule,
sendEmail
}