Skip to content

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

feat: change email text when senderEmail is null

Marc Seitz8f6ea27b5128
diff --git a/components/emails/dataroom-digest-notification.tsx b/components/emails/dataroom-digest-notification.tsx
index e5062575..b82f49d6 100644
--- a/components/emails/dataroom-digest-notification.tsx
+++ b/components/emails/dataroom-digest-notification.tsx
@@ -24,14 +24,14 @@ export default function DataroomDigestNotification({
{ documentName: "Document B" },
{ documentName: "Document C" },
],
- senderEmail = "[email protected]",
+ senderEmail,
url = "https://app.papermark.com/datarooms/123",
preferencesUrl = "https://app.papermark.com/notification-preferences?token=abc",
frequency = "daily",
}: {
dataroomName: string;
documents: DocumentChange[];
- senderEmail: string;
+ senderEmail: string | null;
url: string;
preferencesUrl: string;
frequency: "daily" | "weekly";
@@ -91,9 +91,14 @@ export default function DataroomDigestNotification({
reserved.
</Text>
<Text className="text-xs">
- You received this {frequency} digest from{" "}
- <span className="font-semibold">{senderEmail}</span> because you
- viewed the dataroom{" "}
+ You received this {frequency} digest{" "}
+ {senderEmail ? (
+ <>
+ from{" "}
+ <span className="font-semibold">{senderEmail}</span>{" "}
+ </>
+ ) : null}
+ because you viewed the dataroom{" "}
<span className="font-semibold">{dataroomName}</span> on
Papermark. If you have any feedback or questions about this
email, simply reply to it.{" "}
diff --git a/components/emails/dataroom-notification.tsx b/components/emails/dataroom-notification.tsx
index f690c3fb..5bb59f16 100644
--- a/components/emails/dataroom-notification.tsx
+++ b/components/emails/dataroom-notification.tsx
@@ -16,13 +16,13 @@ import {
export default function DataroomNotification({
dataroomName = "Example Data Room",
documentName = "Example Document",
- senderEmail = "[email protected]",
+ senderEmail,
url = "https://app.papermark.com/datarooms/123",
unsubscribeUrl = "https://app.papermark.com/datarooms/123/unsubscribe",
}: {
dataroomName: string;
documentName: string | undefined;
- senderEmail: string;
+ senderEmail: string | null;
url: string;
unsubscribeUrl: string;
}) {
@@ -67,9 +67,14 @@ export default function DataroomNotification({
reserved.
</Text>
<Text className="text-xs">
- You received this email from{" "}
- <span className="font-semibold">{senderEmail}</span> because you
- viewed the dataroom{" "}
+ You received this email{" "}
+ {senderEmail ? (
+ <>
+ from{" "}
+ <span className="font-semibold">{senderEmail}</span>{" "}
+ </>
+ ) : null}
+ because you viewed the dataroom{" "}
<span className="font-semibold">{dataroomName}</span> on
Papermark. If you have any feedback or questions about this
email, simply reply to it.{" "}
diff --git a/lib/emails/process-dataroom-digest.ts b/lib/emails/process-dataroom-digest.ts
index 792a123a..6c3e06b1 100644
--- a/lib/emails/process-dataroom-digest.ts
+++ b/lib/emails/process-dataroom-digest.ts
@@ -116,7 +116,7 @@ async function processBatch(batch: DigestBatch, frequency: "daily" | "weekly") {
await sendDataroomDigestNotification({
dataroomName: dataroom?.name ?? "Unknown Dataroom",
documents,
- senderEmail: senderUser?.email ?? "[email protected]",
+ senderEmail: senderUser?.email ?? null,
to: viewer.email,
url: linkUrl,
preferencesUrl,
diff --git a/lib/emails/send-dataroom-digest-notification.ts b/lib/emails/send-dataroom-digest-notification.ts
index 05d52c59..30096499 100644
--- a/lib/emails/send-dataroom-digest-notification.ts
+++ b/lib/emails/send-dataroom-digest-notification.ts
@@ -13,7 +13,7 @@ export const sendDataroomDigestNotification = async ({
}: {
dataroomName: string;
documents: { documentName: string }[];
- senderEmail: string;
+ senderEmail: string | null;
to: string;
url: string;
preferencesUrl: string;
diff --git a/lib/emails/send-dataroom-notification.ts b/lib/emails/send-dataroom-notification.ts
index d30b276d..efde0900 100644
--- a/lib/emails/send-dataroom-notification.ts
+++ b/lib/emails/send-dataroom-notification.ts
@@ -12,7 +12,7 @@ export const sendDataroomNotification = async ({
}: {
dataroomName: string;
documentName: string | undefined;
- senderEmail: string;
+ senderEmail: string | null;
to: string;
url: string;
unsubscribeUrl: string;
diff --git a/pages/api/jobs/send-dataroom-new-document-notification.ts b/pages/api/jobs/send-dataroom-new-document-notification.ts
index 37169fd0..7bb0a9c9 100644
--- a/pages/api/jobs/send-dataroom-new-document-notification.ts
+++ b/pages/api/jobs/send-dataroom-new-document-notification.ts
@@ -95,7 +95,7 @@ export default async function handle(
},
});
- let senderEmail = "[email protected]";
+ let senderEmail: string | null = null;
if (senderUserId) {
const user = await prisma.user.findUnique({
where: { id: senderUserId },