mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 15:53:02 +10:00
19 lines
651 B
TypeScript
19 lines
651 B
TypeScript
import { signingCompleteTemplate } from "@documenso/lib/mail";
|
|
import { addDigitalSignature } from "@documenso/signing/addDigitalSignature";
|
|
import { sendMail } from "./sendMail";
|
|
import { Document as PrismaDocument } from "@prisma/client";
|
|
|
|
export const sendSigningDoneMail = async (recipient: any, document: PrismaDocument, user: any) => {
|
|
await sendMail(
|
|
user.email,
|
|
`Completed: "${document.title}"`,
|
|
signingCompleteTemplate(`All recipients have signed "${document.title}".`),
|
|
[
|
|
{
|
|
filename: document.title,
|
|
content: Buffer.from(await addDigitalSignature(document.document), "base64"),
|
|
},
|
|
]
|
|
);
|
|
};
|