mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
fix: custom team email subject (#1450)
Fixed issue where custom email subjects for teams were being ignored.
This commit is contained in:
@ -115,7 +115,9 @@ export const SEND_SIGNING_EMAIL_JOB_DEFINITION = {
|
|||||||
|
|
||||||
if (isTeamDocument && team) {
|
if (isTeamDocument && team) {
|
||||||
emailSubject = i18n._(msg`${team.name} invited you to ${recipientActionVerb} a document`);
|
emailSubject = i18n._(msg`${team.name} invited you to ${recipientActionVerb} a document`);
|
||||||
emailMessage = i18n._(
|
emailMessage =
|
||||||
|
customEmail?.message ||
|
||||||
|
i18n._(
|
||||||
msg`${user.name} on behalf of ${team.name} has invited you to ${recipientActionVerb} the document "${document.title}".`,
|
msg`${user.name} on behalf of ${team.name} has invited you to ${recipientActionVerb} the document "${document.title}".`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,17 +106,25 @@ export const resendDocument = async ({
|
|||||||
._(RECIPIENT_ROLES_DESCRIPTION[recipient.role].actionVerb)
|
._(RECIPIENT_ROLES_DESCRIPTION[recipient.role].actionVerb)
|
||||||
.toLowerCase();
|
.toLowerCase();
|
||||||
|
|
||||||
let emailMessage = msg`${customEmail?.message || ''}`;
|
let emailMessage = customEmail?.message || '';
|
||||||
let emailSubject = msg`Reminder: Please ${recipientActionVerb} this document`;
|
let emailSubject = i18n._(msg`Reminder: Please ${recipientActionVerb} this document`);
|
||||||
|
|
||||||
if (selfSigner) {
|
if (selfSigner) {
|
||||||
emailMessage = msg`You have initiated the document ${`"${document.title}"`} that requires you to ${recipientActionVerb} it.`;
|
emailMessage = i18n._(
|
||||||
emailSubject = msg`Reminder: Please ${recipientActionVerb} your document`;
|
msg`You have initiated the document ${`"${document.title}"`} that requires you to ${recipientActionVerb} it.`,
|
||||||
|
);
|
||||||
|
emailSubject = i18n._(msg`Reminder: Please ${recipientActionVerb} your document`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isTeamDocument && document.team) {
|
if (isTeamDocument && document.team) {
|
||||||
emailSubject = msg`Reminder: ${document.team.name} invited you to ${recipientActionVerb} a document`;
|
emailSubject = i18n._(
|
||||||
emailMessage = msg`${user.name} on behalf of ${document.team.name} has invited you to ${recipientActionVerb} the document "${document.title}".`;
|
msg`Reminder: ${document.team.name} invited you to ${recipientActionVerb} a document`,
|
||||||
|
);
|
||||||
|
emailMessage =
|
||||||
|
customEmail?.message ||
|
||||||
|
i18n._(
|
||||||
|
msg`${user.name} on behalf of ${document.team.name} has invited you to ${recipientActionVerb} the document "${document.title}".`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const customEmailTemplate = {
|
const customEmailTemplate = {
|
||||||
@ -134,7 +142,7 @@ export const resendDocument = async ({
|
|||||||
inviterEmail: isTeamDocument ? document.team?.teamEmail?.email || user.email : user.email,
|
inviterEmail: isTeamDocument ? document.team?.teamEmail?.email || user.email : user.email,
|
||||||
assetBaseUrl,
|
assetBaseUrl,
|
||||||
signDocumentLink,
|
signDocumentLink,
|
||||||
customBody: renderCustomEmailTemplate(i18n._(emailMessage), customEmailTemplate),
|
customBody: renderCustomEmailTemplate(emailMessage, customEmailTemplate),
|
||||||
role: recipient.role,
|
role: recipient.role,
|
||||||
selfSigner,
|
selfSigner,
|
||||||
isTeamInvite: isTeamDocument,
|
isTeamInvite: isTeamDocument,
|
||||||
@ -165,7 +173,7 @@ export const resendDocument = async ({
|
|||||||
i18n._(msg`Reminder: ${customEmail.subject}`),
|
i18n._(msg`Reminder: ${customEmail.subject}`),
|
||||||
customEmailTemplate,
|
customEmailTemplate,
|
||||||
)
|
)
|
||||||
: i18n._(emailSubject),
|
: emailSubject,
|
||||||
html,
|
html,
|
||||||
text,
|
text,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user