mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
document status, dashboard
This commit is contained in:
@ -1,2 +1,2 @@
|
||||
export { sendSigningRequestMail } from "./sendSigningRequestMail";
|
||||
export { sendSigningRequest as sendSigningRequestMail } from "./sendSigningRequestMail";
|
||||
export { sendSignedMail } from "./sendSignedMail";
|
||||
|
||||
@ -1,8 +1,26 @@
|
||||
import prisma from "@documenso/prisma";
|
||||
import { sendMail } from "./sendMail";
|
||||
export const sendSigningRequestMail = async (recipient: any, document: any) => {
|
||||
import { SendStatus, DocumentStatus } from "@prisma/client";
|
||||
|
||||
export const sendSigningRequest = async (recipient: any, document: any) => {
|
||||
// todo errror handling
|
||||
await sendMail(
|
||||
recipient.email,
|
||||
`Please sign ${document.title}`,
|
||||
`${document.User.name} has sent you a document to sign. Click <b><a href="${process.env.NEXT_PUBLIC_WEBAPP_URL}/documents/${document.id}/sign">SIGN DOCUMENT</a></b> to sign it now.`
|
||||
);
|
||||
|
||||
await prisma.recipient.update({
|
||||
where: {
|
||||
id: recipient.id,
|
||||
},
|
||||
data: { sendStatus: SendStatus.SENT },
|
||||
});
|
||||
|
||||
await prisma.document.update({
|
||||
where: {
|
||||
id: document.id,
|
||||
},
|
||||
data: { status: DocumentStatus.PENDING },
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user