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, });