mailer/templates/Message.tsx

48 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

import { Body, Container, Html, Markdown, Preview } from 'jsx-email'
import { Signature } from './components/Signature.tsx'
import type { Template } from '../types.ts'
import { BaseStyle, bodyCss, messageCss, textCss } from './styles/base.tsx'
import type { JSX } from 'preact'
function Message(
{ summary, body }: { summary?: string; body: string },
): JSX.Element {
return (
<Html lang='fr' style={{ fontSize: '14px' }}>
<BaseStyle />
<Preview>{summary}</Preview>
<Body style={bodyCss}>
<Container style={messageCss}>
<Markdown style={textCss}>{body}</Markdown>
</Container>
<Signature />
</Body>
</Html>
)
}
2024-04-02 15:11:28 +02:00
const template: Template<typeof Message, Parameters<typeof Message>[0]> = {
props: [
{
name: 'Résumé',
description: 'Résumé du mail.',
required: false,
multiline: false,
tag: 'summary',
},
{
name: 'Message',
description: 'Contenu du mail (markdown).',
required: true,
multiline: true,
tag: 'body',
},
],
name: 'message',
description: 'Message mail en markdown.',
builder: Message,
}
export default template
//summary <90c