2023-01-26 16:20:48 +01:00
|
|
|
import { sendMail } from "./sendMail";
|
|
|
|
|
import { NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib/constants";
|
2023-01-30 20:27:32 +01:00
|
|
|
import { transactionEmailTemplate } from "@documenso/lib/mail";
|
2023-01-26 16:20:48 +01:00
|
|
|
|
2023-02-21 16:15:36 +01:00
|
|
|
export const sendSigningDoneMail = async (
|
2023-02-09 19:17:34 +01:00
|
|
|
recipient: any,
|
|
|
|
|
document: any,
|
|
|
|
|
user: any
|
|
|
|
|
) => {
|
2023-01-26 16:20:48 +01:00
|
|
|
// todo check if recipient has an account
|
2023-01-27 18:15:41 +01:00
|
|
|
await sendMail(
|
2023-02-21 16:30:29 +01:00
|
|
|
user.email,
|
|
|
|
|
`Completed: "${document.title}"`,
|
2023-01-30 20:27:32 +01:00
|
|
|
transactionEmailTemplate(
|
2023-02-21 16:30:29 +01:00
|
|
|
`All recipients have signed "${document.title}"`,
|
2023-01-30 20:27:32 +01:00
|
|
|
document,
|
|
|
|
|
recipient,
|
2023-02-21 16:15:36 +01:00
|
|
|
`${NEXT_PUBLIC_WEBAPP_URL}/api/documents/${document.id}`,
|
|
|
|
|
`Download "${document.title}"`,
|
2023-02-09 19:17:34 +01:00
|
|
|
user
|
2023-01-30 20:27:32 +01:00
|
|
|
)
|
2023-01-26 16:20:48 +01:00
|
|
|
);
|
|
|
|
|
};
|