mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
chore: send document owner email
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
@ -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({
|
||||
|
||||
Reference in New Issue
Block a user