mirror of
https://github.com/documenso/documenso
synced 2026-05-24 09:28:27 +00:00
read status
This commit is contained in:
parent
59f5297dd7
commit
48a8fce724
2 changed files with 21 additions and 1 deletions
|
|
@ -1,8 +1,11 @@
|
|||
import prisma from "@documenso/prisma";
|
||||
import Head from "next/head";
|
||||
import { ReactElement } from "react";
|
||||
import Layout from "../../../components/layout";
|
||||
import Logo from "../../../components/logo";
|
||||
import { NextPageWithLayout } from "../../_app";
|
||||
import { Router } from "next/router";
|
||||
import { ReadStatus } from "@prisma/client";
|
||||
|
||||
const SignPage: NextPageWithLayout = () => {
|
||||
return (
|
||||
|
|
@ -19,4 +22,21 @@ SignPage.getLayout = function getLayout(page: ReactElement) {
|
|||
return <Layout>{page}</Layout>;
|
||||
};
|
||||
|
||||
export async function getServerSideProps(context: any) {
|
||||
const recipientToken: string = context.query["token"];
|
||||
|
||||
await prisma.recipient.updateMany({
|
||||
where: {
|
||||
token: recipientToken,
|
||||
},
|
||||
data: {
|
||||
readStatus: ReadStatus.OPENED,
|
||||
},
|
||||
});
|
||||
|
||||
return {
|
||||
props: {},
|
||||
};
|
||||
}
|
||||
|
||||
export default SignPage;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ export const sendSignedMail = async (document: any, recipient: any) => {
|
|||
await sendMail(
|
||||
document.user.email,
|
||||
`${recipient.email} signed ${document.title}`,
|
||||
`Hi ${document.user.name}, ${recipient.email} has signed your document ${document.title}. Click <a href="${NEXT_PUBLIC_WEBAPP_URL}/document/${document.id}"> VIEW DOCUMENT</a> to view it now.`
|
||||
`Hi ${document.user.name}, ${recipient.email} has signed your document ${document.title}. Click <a href="${NEXT_PUBLIC_WEBAPP_URL}/document/${document.id}?token=${recipient.token}"> VIEW DOCUMENT</a> to view it now.`
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue