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

21 lines
652 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-01-30 17:33:03 +01:00
export const sendSignedMail = async (recipient: any, document: 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}`,
`View Document`
)
2023-01-26 16:20:48 +01:00
);
};