Skip to content

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

refactor: add system email sender for generic messages

Marc Seitz70f18b812582
diff --git a/lib/emails/send-deleted-domain.ts b/lib/emails/send-deleted-domain.ts
index ce955aa6..7ae66edc 100644
--- a/lib/emails/send-deleted-domain.ts
+++ b/lib/emails/send-deleted-domain.ts
@@ -8,5 +8,6 @@ export const sendDeletedDomainEmail = async (email: string, domain: string) => {
subject: `Your domain ${domain} has been deleted`,
react: emailTemplate,
test: process.env.NODE_ENV === "development",
+ system: true,
});
};
diff --git a/lib/emails/send-invalid-domain.ts b/lib/emails/send-invalid-domain.ts
index f094060d..a3b705fd 100644
--- a/lib/emails/send-invalid-domain.ts
+++ b/lib/emails/send-invalid-domain.ts
@@ -8,5 +8,6 @@ export const sendInvalidDomainEmail = async (email: string, domain: string, inva
subject: `Your domain ${domain} needs to be configured`,
react: emailTemplate,
test: process.env.NODE_ENV === "development",
+ system: true,
});
};
diff --git a/lib/emails/send-teammate-invite.ts b/lib/emails/send-teammate-invite.ts
index 936c5d15..f5960fe2 100644
--- a/lib/emails/send-teammate-invite.ts
+++ b/lib/emails/send-teammate-invite.ts
@@ -27,5 +27,6 @@ export const sendTeammateInviteEmail = async ({
token,
}),
test: process.env.NODE_ENV === "development",
+ system: true,
});
};
diff --git a/lib/emails/send-trial-end-final-reminder.ts b/lib/emails/send-trial-end-final-reminder.ts
index b2e04426..72355c91 100644
--- a/lib/emails/send-trial-end-final-reminder.ts
+++ b/lib/emails/send-trial-end-final-reminder.ts
@@ -8,5 +8,6 @@ export const sendTrialEndFinalReminderEmail = async (email: string, name: string
subject: `Your pro trial expires in 24 hours`,
react: emailTemplate,
test: process.env.NODE_ENV === "development",
+ system: true,
});
};
diff --git a/lib/emails/send-trial-end-reminder.ts b/lib/emails/send-trial-end-reminder.ts
index 9f4ad206..29dbf376 100644
--- a/lib/emails/send-trial-end-reminder.ts
+++ b/lib/emails/send-trial-end-reminder.ts
@@ -8,5 +8,6 @@ export const sendTrialEndReminderEmail = async (email: string, name: string | nu
subject: `Your pro trial is ending soon`,
react: emailTemplate,
test: process.env.NODE_ENV === "development",
+ system: true,
});
};
diff --git a/lib/emails/send-viewed-document.ts b/lib/emails/send-viewed-document.ts
index 688a951b..0f20e0a2 100644
--- a/lib/emails/send-viewed-document.ts
+++ b/lib/emails/send-viewed-document.ts
@@ -13,5 +13,6 @@ export const sendViewedDocumentEmail = async (
subject: `Your document has been viewed: ${documentName}`,
react: emailTemplate,
test: process.env.NODE_ENV === "development",
+ system: true,
});
};
diff --git a/lib/resend.ts b/lib/resend.ts
index bf90112a..bb73f9b5 100644
--- a/lib/resend.ts
+++ b/lib/resend.ts
@@ -11,12 +11,14 @@ export const sendEmail = async ({
subject,
react,
marketing,
+ system,
test,
}: {
to: string;
subject: string;
react: ReactElement<any, string | JSXElementConstructor<any>>;
marketing?: boolean;
+ system?: boolean;
test?: boolean;
}) => {
if (!resend) {
@@ -28,7 +30,7 @@ export const sendEmail = async ({
return resend.emails.send({
from: marketing
? "Marc from Papermark <[email protected]>"
- : "Marc from Papermark <[email protected]>",
+ : system ? "Papermark <[email protected]>" : "Marc from Papermark <[email protected]>",
to: test ? "[email protected]" : to,
reply_to: marketing ? "[email protected]" : undefined,
subject,