From 766a63d5246cae2f4e3213518bae245b406ad96a Mon Sep 17 00:00:00 2001 From: Ravinou Date: Sun, 20 Apr 2025 11:27:18 +0200 Subject: [PATCH] =?UTF-8?q?refactor:=20=E2=9A=A1=20email=20template=20atta?= =?UTF-8?q?chement=20path=20for=20typescript=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helpers/templates/emailAlertStatus.ts | 4 +++- helpers/templates/emailTest.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/helpers/templates/emailAlertStatus.ts b/helpers/templates/emailAlertStatus.ts index e1dbee4..c064d72 100644 --- a/helpers/templates/emailAlertStatus.ts +++ b/helpers/templates/emailAlertStatus.ts @@ -1,3 +1,5 @@ +import path from 'path'; + export default function emailTest(mailTo: string, username: string, aliasList: string[]) { const aliasTemplate = (x: string[]) => { let str = ''; @@ -126,7 +128,7 @@ export default function emailTest(mailTo: string, username: string, aliasList: s `, attachments: [ { - path: 'helpers/templates/attachments/alert-icon.png', + path: path.join(process.cwd(), 'helpers/templates/attachments/alert-icon.png'), cid: 'alert-icon', }, ], diff --git a/helpers/templates/emailTest.ts b/helpers/templates/emailTest.ts index 7faff0a..db8c3d5 100644 --- a/helpers/templates/emailTest.ts +++ b/helpers/templates/emailTest.ts @@ -1,3 +1,5 @@ +import path from 'path'; + export default function emailTest(mailTo: string, username: string) { const template = { from: 'BorgWarehouse' + '<' + process.env.MAIL_SMTP_FROM + '>', @@ -94,7 +96,7 @@ export default function emailTest(mailTo: string, username: string) { `, attachments: [ { - path: 'helpers/templates/attachments/valid-icon.png', + path: path.join(process.cwd(), 'helpers/templates/attachments/valid-icon.png'), cid: 'valid-icon', }, ],