mailer/templates/Message.tsx

47 lines
1 KiB
TypeScript

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'
function Message(
{ summary, body }: { summary?: string; body: string },
) {
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>
)
}
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