2024-04-02 14:45:12 +02:00
|
|
|
import { Body, Html, Markdown, Preview, Section, Text } from 'jsx-email'
|
|
|
|
import type { Template } from '../types.ts'
|
|
|
|
|
|
|
|
function Message(
|
|
|
|
{ summary, body }: { summary?: string; body: string },
|
|
|
|
) {
|
|
|
|
return (
|
|
|
|
<Html lang='fr'>
|
|
|
|
<Preview>{summary}</Preview>
|
|
|
|
<Body style={{ backgroundColor: '#61dafb' }}>
|
|
|
|
<Markdown>{body}</Markdown>
|
|
|
|
<Section>
|
|
|
|
<Text>Coh@bit</Text>
|
|
|
|
</Section>
|
|
|
|
</Body>
|
|
|
|
</Html>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-04-02 15:11:28 +02:00
|
|
|
const template: Template<typeof Message, Parameters<typeof Message>[0]> = {
|
2024-04-02 14:45:12 +02:00
|
|
|
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
|