feat: add option to disable Document created from template (#2609)

This commit is contained in:
Catalin Pit
2026-03-23 06:11:42 +02:00
committed by GitHub
parent ace472c294
commit 5be71cca21
8 changed files with 72 additions and 9 deletions
+9
View File
@@ -11,6 +11,7 @@ export enum DocumentEmailEvents {
DocumentDeleted = 'documentDeleted',
OwnerDocumentCompleted = 'ownerDocumentCompleted',
OwnerRecipientExpired = 'ownerRecipientExpired',
OwnerDocumentCreated = 'ownerDocumentCreated',
}
export const ZDocumentEmailSettingsSchema = z
@@ -59,6 +60,12 @@ export const ZDocumentEmailSettingsSchema = z
"Whether to send an email to the document owner when a recipient's signing window has expired.",
)
.default(true),
ownerDocumentCreated: z
.boolean()
.describe(
'Whether to send an email to the document owner when a document is created from a direct template.',
)
.default(true),
})
.strip()
.catch(() => ({ ...DEFAULT_DOCUMENT_EMAIL_SETTINGS }));
@@ -86,6 +93,7 @@ export const extractDerivedDocumentEmailSettings = (
documentDeleted: false,
ownerDocumentCompleted: emailSettings.ownerDocumentCompleted,
ownerRecipientExpired: emailSettings.ownerRecipientExpired,
ownerDocumentCreated: emailSettings.ownerDocumentCreated,
};
};
@@ -98,4 +106,5 @@ export const DEFAULT_DOCUMENT_EMAIL_SETTINGS: TDocumentEmailSettings = {
documentDeleted: true,
ownerDocumentCompleted: true,
ownerRecipientExpired: true,
ownerDocumentCreated: true,
};