fix: Usage of env.URL before environment validation

This commit is contained in:
Tom Moor committed 2024-09-05 18:59:41 -04:00
1 parent ed22891a69
commit e2355d63a2
1 file changed
+6 -3
+6 -3
View File
@@ -1,8 +1,6 @@
import { NotificationEventType } from "@shared/types";
import { getBaseDomain } from "@shared/utils/domains";
const Domain = getBaseDomain();
const EmailThreadSupportedNotifications = [
NotificationEventType.PublishDocument,
NotificationEventType.UpdateDocument,
@@ -41,4 +39,9 @@ export const getEmailThreadEventGroup = (
}
};
export const getEmailMessageId = (text: string) => `<${text}@${Domain}>`;
let baseDomain;
export const getEmailMessageId = (notificationId: string) => {
baseDomain ||= getBaseDomain();
return `<${notificationId}@${baseDomain}>`;
};