chore: send document owner email

Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
Adithya Krishna
2024-03-15 22:26:31 +05:30
parent 52afae331e
commit f012826b6b
2 changed files with 15 additions and 6 deletions

View File

@ -12,6 +12,7 @@ import { DocumentStatus, RecipientRole, SigningStatus } from '@documenso/prisma/
import { WebhookTriggerEvents } from '@documenso/prisma/client';
import { signPdf } from '@documenso/signing';
import { getRequiredServerComponentSession } from '../../next-auth/get-server-component-session';
import type { RequestMetadata } from '../../universal/extract-request-metadata';
import { getFile } from '../../universal/upload/get-file';
import { putFile } from '../../universal/upload/put-file';
@ -46,6 +47,8 @@ export const sealDocument = async ({
const { documentData } = document;
const { user: documentOwner } = await getRequiredServerComponentSession();
if (!documentData) {
throw new Error(`Document ${document.id} has no document data`);
}
@ -169,7 +172,7 @@ export const sealDocument = async ({
});
if (sendEmail && !isResealing) {
await sendCompletedEmail({ documentId, requestMetadata });
await sendCompletedEmail({ documentId, requestMetadata, documentOwner });
}
await triggerWebhook({