Files
sign/packages/lib/mail/sendSignedMail.ts

26 lines
683 B
TypeScript
Raw Normal View History

2023-01-26 16:20:48 +01:00
import { sendMail } from "./sendMail";
import { NEXT_PUBLIC_WEBAPP_URL } from "@documenso/lib/constants";
import { transactionEmailTemplate } from "@documenso/lib/mail";
2023-01-26 16:20:48 +01:00
2023-02-09 19:17:34 +01:00
export const sendSignedMail = async (
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-01-30 17:33:03 +01:00
document.User.email,
`${recipient.email} signed "${document.title}"`,
transactionEmailTemplate(
`${document.User.name || recipient.email} has signed your document ${
document.title
}`,
document,
recipient,
`${NEXT_PUBLIC_WEBAPP_URL}/documents/${document.id}`,
2023-02-09 19:17:34 +01:00
`View Document`,
user
)
2023-01-26 16:20:48 +01:00
);
};