Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: throw if no linkurl present

Marc Seitzd7207be0ebf4
diff --git a/lib/emails/process-dataroom-digest.ts b/lib/emails/process-dataroom-digest.ts
index c94a266c..e430fb8a 100644
--- a/lib/emails/process-dataroom-digest.ts
+++ b/lib/emails/process-dataroom-digest.ts
@@ -95,13 +95,15 @@ async function processBatch(batch: DigestBatch, frequency: "daily" | "weekly") {
}));
const link = viewer.views[0]?.link;
- let linkUrl = "";
+ let linkUrl: string | undefined;
if (link?.domainId && link.domainSlug && link.slug) {
linkUrl = `https://${link.domainSlug}/${link.slug}`;
} else if (link) {
linkUrl = `${process.env.NEXT_PUBLIC_MARKETING_URL}/view/${link.id}`;
}
+ if (!linkUrl) return;
+
const preferencesUrl = generateUnsubscribeUrl({
viewerId: batch.viewerId,
dataroomId: batch.dataroomId,