From 1164d9578eb2145ffdaca63e3b3107810734c351 Mon Sep 17 00:00:00 2001 From: Zonaib Bokhari <48220328+xonaib@users.noreply.github.com> Date: Mon, 21 Sep 2026 11:20:39 +0500 Subject: [PATCH] Respect hidden sender details in document invite emails (#3061) --- .../lib/server-only/document/resend-document.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/lib/server-only/document/resend-document.ts b/packages/lib/server-only/document/resend-document.ts index 29b20ed15..41c9681f1 100644 --- a/packages/lib/server-only/document/resend-document.ts +++ b/packages/lib/server-only/document/resend-document.ts @@ -169,6 +169,7 @@ export const resendDocument = async ({ id, userId, recipients, teamId, requestMe const { branding, emailLanguage, + settings, organisationType, senderEmail, replyToEmail, @@ -225,11 +226,16 @@ export const resendDocument = async ({ id, userId, recipients, teamId, requestMe if (organisationType === OrganisationType.ORGANISATION) { emailSubject = i18n._(msg`Reminder: ${envelope.team.name} invited you to ${recipientActionVerb} a document`); - emailMessage = - envelope.documentMeta.message || - i18n._( - msg`${user.name || user.email} on behalf of "${envelope.team.name}" has invited you to ${recipientActionVerb} the document "${envelope.title}".`, + + if (!emailMessage) { + const inviterName = user.name || user.email; + + emailMessage = i18n._( + settings.includeSenderDetails + ? msg`${inviterName} on behalf of "${envelope.team.name}" has invited you to ${recipientActionVerb} the document "${envelope.title}".` + : msg`${envelope.team.name} has invited you to ${recipientActionVerb} the document "${envelope.title}".`, ); + } } const customEmailTemplate = { @@ -256,6 +262,7 @@ export const resendDocument = async ({ id, userId, recipients, teamId, requestMe selfSigner, organisationType, teamName: envelope.team?.name, + includeSenderDetails: settings.includeSenderDetails, reportUrl, });