fix: add email disable flag (#2931)

This commit is contained in:
David Nguyen
2026-06-05 17:55:10 +10:00
committed by GitHub
parent 0ecde7ac1e
commit ebf5b75a19
19 changed files with 116 additions and 198 deletions
@@ -108,9 +108,9 @@ export const run = async ({ payload, io }: { payload: TProcessSigningReminderJob
organisationType,
senderEmail,
replyToEmail,
isOrganisationOwnerDisabled,
organisationId,
claims,
emailsDisabled,
} = await getEmailContext({
emailType: 'RECIPIENT',
source: {
@@ -120,9 +120,10 @@ export const run = async ({ payload, io }: { payload: TProcessSigningReminderJob
meta: envelope.documentMeta,
});
// Don't send reminders on behalf of a disabled (e.g. banned) account.
if (envelope.user.disabled || isOrganisationOwnerDisabled) {
io.logger.info(`Envelope ${envelope.id} owner is disabled, skipping reminder`);
// Don't send reminders if the owner is disabled (e.g. banned) or the organisation
// has email sending disabled.
if (envelope.user.disabled || emailsDisabled) {
io.logger.info(`Envelope ${envelope.id} skipping reminder: owner disabled or organisation emails disabled`);
return;
}