import * as React from 'react'; import { Body, Button, Container, Head, Html, Img, Link, Preview, Section, Tailwind, Text, render, } from '@react-email/components'; interface DocumensoEmailProps { email?: string; name?: string; firstName?: string; documentSigningLink?: string; documentName?: string; downloadLink?: string; reviewLink?: string; numberOfSigners?: number; type: 'invite' | 'signed' | 'completed'; } export const DocumensoEmail = ({ documentSigningLink = 'https://documenso.com', downloadLink = 'https://documenso.com', reviewLink = 'https://documenso.com', email = 'duncan@documenso.com', name = 'Ephraim Atta-Duncan', firstName = 'Ephraim', documentName = 'Open Source Pledge.pdf', numberOfSigners = 2, type = 'signed', }: DocumensoEmailProps) => { const previewText = type === 'completed' ? 'Completed Document' : `Sign Document`; return ( {previewText}
Documenso Logo
Documenso
{type === 'completed' && ( Completed )} {type === 'signed' && ( Waiting for {numberOfSigners} {numberOfSigners === 1 ? 'person' : 'people'} to sign )} {type === 'invite' ? `${name} has invited you to sign “${documentName}”` : `“${documentName}” was signed by ${name}`} {type === 'invite' ? 'Continue by signing the document.' : 'Continue by downloading or reviewing the document.'}
{type === 'invite' && ( )} {type !== 'invite' && (
)}
{type === 'invite' && ( <> {name} ({email}) Hi,
Please sign the attached document. Magna magna adipisicing dolore minim et aliquip ipsum esse ut nulla ad sint irure.
- {firstName}
)} This document was sent using{' '} Documenso. Documenso
2261 Market Street, #5211, San Francisco, CA 94114, USA
); }; export const emailHtml = (props: DocumensoEmailProps) => render(, { pretty: true, }); export const emailText = (props: DocumensoEmailProps) => render(, { plainText: true, });