fix: correctly log cc emails (#2913)

This commit is contained in:
David Nguyen
2026-06-02 15:04:02 +10:00
committed by GitHub
parent c50a01d004
commit d2f60b13fd
7 changed files with 284 additions and 85 deletions
@@ -55,6 +55,11 @@ export const run = async ({ payload, io }: { payload: TSendSigningEmailJobDefini
},
include: {
documentMeta: true,
user: {
select: {
disabled: true,
},
},
team: {
select: {
teamEmail: true,
@@ -84,15 +89,29 @@ export const run = async ({ payload, io }: { payload: TSendSigningEmailJobDefini
return;
}
const { branding, emailLanguage, settings, organisationType, senderEmail, replyToEmail, organisationId, claims } =
await getEmailContext({
emailType: 'RECIPIENT',
source: {
type: 'team',
teamId: envelope.teamId,
},
meta: envelope.documentMeta,
});
const {
branding,
emailLanguage,
settings,
organisationType,
senderEmail,
replyToEmail,
organisationId,
claims,
isOrganisationOwnerDisabled,
} = await getEmailContext({
emailType: 'RECIPIENT',
source: {
type: 'team',
teamId: envelope.teamId,
},
meta: envelope.documentMeta,
});
// Don't send signing invitations on behalf of a disabled (e.g. banned) account.
if (envelope.user.disabled || isOrganisationOwnerDisabled) {
return;
}
const customEmail = envelope?.documentMeta;
const isDirectTemplate = envelope.source === DocumentSource.TEMPLATE_DIRECT_LINK;