mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 09:25:08 +10:00
fix: add email reporting (#2918)
This commit is contained in:
@@ -5,13 +5,26 @@ import { useBranding } from '../providers/branding';
|
||||
|
||||
export type TemplateFooterProps = {
|
||||
isDocument?: boolean;
|
||||
reportUrl?: string;
|
||||
};
|
||||
|
||||
export const TemplateFooter = ({ isDocument = true }: TemplateFooterProps) => {
|
||||
export const TemplateFooter = ({ isDocument = true, reportUrl }: TemplateFooterProps) => {
|
||||
const branding = useBranding();
|
||||
|
||||
return (
|
||||
<Section>
|
||||
{reportUrl && (
|
||||
<Text className="my-4 text-base text-slate-400">
|
||||
<Trans>
|
||||
Did not expect this email?{' '}
|
||||
<Link className="text-[#7AC455]" href={reportUrl}>
|
||||
Click here to report the sender
|
||||
</Link>
|
||||
. Never sign a document you don't recognize or weren't expecting.
|
||||
</Trans>
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{isDocument && !branding.brandingHidePoweredBy && (
|
||||
<Text className="my-4 text-base text-slate-400">
|
||||
<Trans>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { TemplateFooter } from '../template-components/template-footer';
|
||||
|
||||
export type DocumentCompletedEmailTemplateProps = Partial<TemplateDocumentCompletedProps> & {
|
||||
customBody?: string;
|
||||
reportUrl?: string;
|
||||
};
|
||||
|
||||
export const DocumentCompletedEmailTemplate = ({
|
||||
@@ -16,6 +17,7 @@ export const DocumentCompletedEmailTemplate = ({
|
||||
documentName = 'Open Source Pledge.pdf',
|
||||
assetBaseUrl = 'http://localhost:3002',
|
||||
customBody,
|
||||
reportUrl,
|
||||
}: DocumentCompletedEmailTemplateProps) => {
|
||||
const { _ } = useLingui();
|
||||
const branding = useBranding();
|
||||
@@ -51,7 +53,7 @@ export const DocumentCompletedEmailTemplate = ({
|
||||
</Container>
|
||||
|
||||
<Container className="mx-auto max-w-xl">
|
||||
<TemplateFooter />
|
||||
<TemplateFooter reportUrl={reportUrl} />
|
||||
</Container>
|
||||
</Section>
|
||||
</Body>
|
||||
|
||||
@@ -20,6 +20,7 @@ export type DocumentInviteEmailTemplateProps = Partial<TemplateDocumentInvitePro
|
||||
teamEmail?: string;
|
||||
includeSenderDetails?: boolean;
|
||||
organisationType?: OrganisationType;
|
||||
reportUrl?: string;
|
||||
};
|
||||
|
||||
export const DocumentInviteEmailTemplate = ({
|
||||
@@ -34,6 +35,7 @@ export const DocumentInviteEmailTemplate = ({
|
||||
teamName = '',
|
||||
includeSenderDetails,
|
||||
organisationType,
|
||||
reportUrl,
|
||||
}: DocumentInviteEmailTemplateProps) => {
|
||||
const { _ } = useLingui();
|
||||
const branding = useBranding();
|
||||
@@ -114,7 +116,7 @@ export const DocumentInviteEmailTemplate = ({
|
||||
<Hr className="mx-auto mt-12 max-w-xl" />
|
||||
|
||||
<Container className="mx-auto max-w-xl">
|
||||
<TemplateFooter />
|
||||
<TemplateFooter reportUrl={reportUrl} />
|
||||
</Container>
|
||||
</Section>
|
||||
</Body>
|
||||
|
||||
@@ -16,6 +16,7 @@ export type DocumentReminderEmailTemplateProps = {
|
||||
assetBaseUrl?: string;
|
||||
customBody?: string;
|
||||
role: RecipientRole;
|
||||
reportUrl?: string;
|
||||
};
|
||||
|
||||
export const DocumentReminderEmailTemplate = ({
|
||||
@@ -25,6 +26,7 @@ export const DocumentReminderEmailTemplate = ({
|
||||
assetBaseUrl = 'http://localhost:3002',
|
||||
customBody,
|
||||
role = RecipientRole.SIGNER,
|
||||
reportUrl,
|
||||
}: DocumentReminderEmailTemplateProps) => {
|
||||
const { _ } = useLingui();
|
||||
const branding = useBranding();
|
||||
@@ -75,7 +77,7 @@ export const DocumentReminderEmailTemplate = ({
|
||||
<Hr className="mx-auto mt-12 max-w-xl" />
|
||||
|
||||
<Container className="mx-auto max-w-xl">
|
||||
<TemplateFooter />
|
||||
<TemplateFooter reportUrl={reportUrl} />
|
||||
</Container>
|
||||
</Section>
|
||||
</Body>
|
||||
|
||||
Reference in New Issue
Block a user