Skip to content

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

feat(resend): make from address customizable

Marc Seitz21f3f8c54a8e
diff --git a/lib/resend.ts b/lib/resend.ts
index 0ff7c8a4..a4b6cd86 100644
--- a/lib/resend.ts
+++ b/lib/resend.ts
@@ -13,6 +13,7 @@ export const sendEmail = async ({
to,
subject,
react,
+ from,
marketing,
system,
verify,
@@ -25,6 +26,7 @@ export const sendEmail = async ({
to: string;
subject: string;
react: ReactElement<any, string | JSXElementConstructor<any>>;
+ from?: string;
marketing?: boolean;
system?: boolean;
verify?: boolean;
@@ -41,17 +43,21 @@ export const sendEmail = async ({
const plainText = await render(react, { plainText: true });
+ const fromAddress =
+ from ??
+ (marketing
+ ? "Marc from Papermark <[email protected]>"
+ : system
+ ? "Papermark <[email protected]>"
+ : verify
+ ? "Papermark <[email protected]>"
+ : !!scheduledAt
+ ? "Marc Seitz <[email protected]>"
+ : "Marc from Papermark <[email protected]>");
+
try {
const { data, error } = await resend.emails.send({
- from: marketing
- ? "Marc from Papermark <[email protected]>"
- : system
- ? "Papermark <[email protected]>"
- : verify
- ? "Papermark <[email protected]>"
- : !!scheduledAt
- ? "Marc Seitz <[email protected]>"
- : "Marc from Papermark <[email protected]>",
+ from: fromAddress,
to: test ? "[email protected]" : to,
cc: cc,
replyTo: marketing ? "[email protected]" : replyTo,