mirror of
https://github.com/docmost/docmost.git
synced 2026-05-21 01:04:39 +08:00
879aa2c3d8
* feat: watchers notification and email preferences * fix: email copy * digests * clean up * fix * clean up * move backlinks queue-up to history processor * fix * fix keys * feat: group notifications * filter * adjust email digest window
94 lines
2.0 KiB
TypeScript
94 lines
2.0 KiB
TypeScript
import { button as buttonStyle, container, footer, h1, logo, main } from '../css/styles';
|
|
import {
|
|
Body,
|
|
Container,
|
|
Head,
|
|
Html,
|
|
Row,
|
|
Section,
|
|
Text,
|
|
} from '@react-email/components';
|
|
import * as React from 'react';
|
|
|
|
interface MailBodyProps {
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export function MailBody({ children }: MailBodyProps) {
|
|
return (
|
|
<Html>
|
|
<Head />
|
|
<Body style={main}>
|
|
<MailHeader />
|
|
<Container style={container}>{children}</Container>
|
|
<MailFooter />
|
|
</Body>
|
|
</Html>
|
|
);
|
|
}
|
|
|
|
export function MailHeader() {
|
|
return (
|
|
<Section style={logo}>
|
|
{/* <Heading style={h1}>docmost</Heading> */}
|
|
</Section>
|
|
);
|
|
}
|
|
|
|
interface EmailButtonProps {
|
|
href: string;
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export function EmailButton({ href, children }: EmailButtonProps) {
|
|
return (
|
|
<table
|
|
role="presentation"
|
|
cellPadding="0"
|
|
cellSpacing="0"
|
|
style={{ margin: '0 0 15px 15px' }}
|
|
>
|
|
<tr>
|
|
<td
|
|
style={{
|
|
backgroundColor: buttonStyle.backgroundColor,
|
|
borderRadius: buttonStyle.borderRadius,
|
|
textAlign: 'center' as const,
|
|
}}
|
|
>
|
|
<a
|
|
href={href}
|
|
target="_blank"
|
|
style={{
|
|
color: buttonStyle.color,
|
|
fontFamily: buttonStyle.fontFamily,
|
|
fontSize: buttonStyle.fontSize,
|
|
textDecoration: 'none',
|
|
display: 'inline-block',
|
|
padding: '8px 16px',
|
|
}}
|
|
>
|
|
{children}
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
);
|
|
}
|
|
|
|
export function MailFooter() {
|
|
return (
|
|
<Section style={footer}>
|
|
<Row>
|
|
<Text style={{ textAlign: 'center', color: '#706a7b' }}>
|
|
© {new Date().getFullYear()} Docmost, All Rights Reserved <br />
|
|
</Text>
|
|
</Row>
|
|
</Section>
|
|
);
|
|
}
|
|
|
|
export function getGreetingName(name?: string): string {
|
|
return name?.split(' ')[0] || 'there';
|
|
}
|