From 2369aacd2a89b926d9892c482cc6495d1c44f024 Mon Sep 17 00:00:00 2001 From: Faruk AYDIN Date: Mon, 29 Jan 2024 12:48:21 +0100 Subject: [PATCH] fix: Adjust dirname for compile email helper --- packages/backend/src/helpers/compile-email.ee.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/helpers/compile-email.ee.js b/packages/backend/src/helpers/compile-email.ee.js index 3fd7fb4e..ae866a36 100644 --- a/packages/backend/src/helpers/compile-email.ee.js +++ b/packages/backend/src/helpers/compile-email.ee.js @@ -1,6 +1,9 @@ -import * as path from 'path'; -import * as fs from 'fs'; -import * as handlebars from 'handlebars'; +import path from 'path'; +import fs from 'fs'; +import handlebars from 'handlebars'; +import { fileURLToPath } from 'url'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); const compileEmail = (emailPath, replacements = {}) => { const filePath = path.join(__dirname, `../views/emails/${emailPath}.ee.hbs`);