From 4dc9e1295b9fbbc2c14e6142add8a7f2a7b8def6 Mon Sep 17 00:00:00 2001 From: Rohit Saluja Date: Tue, 12 Mar 2024 21:15:17 +0530 Subject: [PATCH] feat: added the templates for the delete of the documents from the admin --- .../template-document-delete.tsx | 35 ++++++++++ packages/email/templates/document-delete.tsx | 69 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 packages/email/template-components/template-document-delete.tsx create mode 100644 packages/email/templates/document-delete.tsx diff --git a/packages/email/template-components/template-document-delete.tsx b/packages/email/template-components/template-document-delete.tsx new file mode 100644 index 000000000..99cbe9706 --- /dev/null +++ b/packages/email/template-components/template-document-delete.tsx @@ -0,0 +1,35 @@ +import { Section, Text } from '../components'; +import { TemplateDocumentImage } from './template-document-image'; + +export interface TemplateDocumentDeleteProps { + inviterName: string; + inviterEmail: string; + reason: string; + documentName: string; + assetBaseUrl: string; +} + +export const TemplateDocumentDelete = ({ + reason, + documentName, + assetBaseUrl, +}: TemplateDocumentDeleteProps) => { + return ( + <> + + +
+ + Your document has been deleted +
"{documentName}" +
+ + Reason as below +
"{reason}" +
+
+ + ); +}; + +export default TemplateDocumentDelete; diff --git a/packages/email/templates/document-delete.tsx b/packages/email/templates/document-delete.tsx new file mode 100644 index 000000000..79e40e3d8 --- /dev/null +++ b/packages/email/templates/document-delete.tsx @@ -0,0 +1,69 @@ +import config from '@documenso/tailwind-config'; + +import { Body, Container, Head, Hr, Html, Img, Preview, Section, Tailwind } from '../components'; +import { + TemplateDocumentDelete, + type TemplateDocumentDeleteProps, +} from '../template-components/template-document-delete'; +import { TemplateFooter } from '../template-components/template-footer'; + +export type DocumentDeleteEmailTemplateProps = Partial; + +export const DocumentDeleteTemplate = ({ + inviterName = 'Lucas Smith', + inviterEmail = 'lucas@documenso.com', + documentName = 'Open Source Pledge.pdf', + assetBaseUrl = 'http://localhost:3002', + reason = 'Unknown', +}: DocumentDeleteEmailTemplateProps) => { + const previewText = `${inviterName} has cancelled the document ${documentName}, you don't need to sign it anymore.`; + + const getAssetUrl = (path: string) => { + return new URL(path, assetBaseUrl).toString(); + }; + + return ( + + + {previewText} + + +
+ +
+ Documenso Logo + +
+
+ +
+ + + + +
+ +
+ + ); +}; + +export default DocumentDeleteTemplate;