Files
documenso/packages/email/template-components/template-document-rejected.tsx
Lucas Smith 5398026b80 feat: signature rejection (#1472)
## Description

Adds support for rejecting a given document informing the document
owner.

Flows for resolving a rejection don't currently exist so it's up to the
document owner to reach out to the recipient and work out a way to move
forward via a new document or offline agreement.

## Related Issue


## Changes Made

- Added new rejection properties to the recipient schema
- Added API endpoints to support rejection
- Added email templates for notifying the document owner and recipient
- Added a dialog on the signing page to start the rejection flow.

## Testing Performed

- Manually tested the flow end to end
- Automated tests are planned
2024-11-14 21:37:42 +11:00

49 lines
1.3 KiB
TypeScript

import { Trans } from '@lingui/macro';
import { Button, Heading, Text } from '../components';
export interface TemplateDocumentRejectedProps {
documentName: string;
recipientName: string;
rejectionReason?: string;
documentUrl: string;
}
export function TemplateDocumentRejected({
documentName,
recipientName: signerName,
rejectionReason,
documentUrl,
}: TemplateDocumentRejectedProps) {
return (
<div className="mt-4">
<Heading className="mb-4 text-center text-2xl font-semibold text-slate-800">
<Trans>Document Rejected</Trans>
</Heading>
<Text className="mb-4 text-base">
<Trans>
{signerName} has rejected the document "{documentName}".
</Trans>
</Text>
{rejectionReason && (
<Text className="mb-4 text-base text-slate-400">
<Trans>Reason for rejection: {rejectionReason}</Trans>
</Text>
)}
<Text className="mb-6 text-base">
<Trans>You can view the document and its status by clicking the button below.</Trans>
</Text>
<Button
href={documentUrl}
className="bg-documenso-500 inline-flex items-center justify-center rounded-lg px-6 py-3 text-center text-sm font-medium text-black no-underline"
>
<Trans>View Document</Trans>
</Button>
</div>
);
}