diff --git a/templates/Message.tsx b/templates/Message.tsx
new file mode 100644
index 0000000..72fd87a
--- /dev/null
+++ b/templates/Message.tsx
@@ -0,0 +1,43 @@
+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 (
+
+ {summary}
+
+ {body}
+
+
+
+ )
+}
+
+const template: Template = {
+ 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
diff --git a/types.ts b/types.ts
index 263dae1..24556b1 100644
--- a/types.ts
+++ b/types.ts
@@ -1,4 +1,4 @@
-import type { JSX } from 'preact'
+import type { FunctionComponent, JSX } from 'preact'
import type { Contact } from './src/contact.ts'
export type Mail = {
@@ -12,3 +12,19 @@ export type Mail = {
attachments: string[]
}
}
+
+export type Template<
+ T extends FunctionComponent,
+ P extends Record,
+> = {
+ name: string
+ description: string
+ builder: T
+ props: {
+ name: string
+ description: string
+ required: boolean
+ multiline: boolean
+ tag: P
+ }[]
+}