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
@@ -62,7 +62,7 @@ export const run = async ({ payload, io }: { payload: TSendOwnerRecipientExpired
return;
}
const { branding, emailLanguage, senderEmail } = await getEmailContext({
const { branding, emailLanguage, senderEmail, emailsDisabled } = await getEmailContext({
emailType: 'RECIPIENT',
source: {
type: 'team',
@@ -71,6 +71,11 @@ export const run = async ({ payload, io }: { payload: TSendOwnerRecipientExpired
meta: documentMeta,
});
// Don't send any emails if the organisation has email sending disabled.
if (emailsDisabled) {
return;
}
const i18n = await getI18nInstance(emailLanguage);
const documentLink = `${NEXT_PUBLIC_WEBAPP_URL()}${formatDocumentsPath(envelope.team.url)}/${envelope.id}`;