diff --git a/server/utils/email.ts b/server/utils/email.ts index e6ee952..fe0c9aa 100644 --- a/server/utils/email.ts +++ b/server/utils/email.ts @@ -1,9 +1,14 @@ import nodemailer from 'nodemailer'; import handlebars from 'handlebars'; import { readFileSync } from 'fs'; -import { join } from 'path'; +import { join, dirname } from 'path'; +import { fileURLToPath } from 'url'; import type { SMTPConfig } from '~/utils/types'; +// ES modules compatibility for __dirname +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + export interface EmailData { to: string; subject: string;