🐛 Malformed shared item URL (#410)

This commit is contained in:
Montassar Ghanmy
2024-03-05 09:18:40 +01:00
committed by GitHub
parent 075b2c8406
commit b26ffb81fd
2 changed files with 4 additions and 3 deletions
@@ -84,8 +84,9 @@ export default class EmailPusherClass
const templatePath = path.join(__dirname, "templates", language, `${template}.eta`);
const subjectPath = path.join(__dirname, "templates", language, `${template}.subject.eta`);
const encodedCompanyId = translator.fromUUID(data.notifications[0].item.company_id);
const encodedFileId = translator.fromUUID(data.notifications[0].item.id);
const encodedUrl = `${this.platformUrl}/client/${encodedCompanyId}/v/shared_with_me/preview/${encodedFileId}`;
const encodedItemId = translator.fromUUID(data.notifications[0].item.id);
const previewType = data.notifications[0].item.is_directory ? "d" : "preview";
const encodedUrl = `${this.platformUrl}/client/${encodedCompanyId}/v/shared_with_me/${previewType}/${encodedItemId}`;
if (!existsSync(templatePath)) {
throw Error(`template not found: ${templatePath}`);