ultisuite-client/lib/mail-automation/webhook-template-variables.ts
R3D347HR4Y 6ec95262af Add OnlyOffice integration and update project configurations
- Updated .env.example to include configuration for OnlyOffice Document Server.
- Modified the workspace configuration to remove the drive-suite path.
- Adjusted TypeScript environment imports for consistency.
- Enhanced Next.js configuration to disable canvas in Webpack.
- Updated package.json to include new dependencies for OnlyOffice and PDF.js.
- Added global styles for OnlyOffice theme integration in the CSS.
- Created new layout and page components for the Drive feature, including public sharing and editing functionalities.
- Updated metadata handling across various layouts to reflect the new app structure.
2026-06-07 15:49:21 +02:00

98 lines
2.4 KiB
TypeScript

export type WebhookTemplateVariable = {
token: string
label: string
description: string
example?: string
}
export type WebhookTemplateVariableGroup = {
id: string
label: string
description: string
variables: WebhookTemplateVariable[]
}
/** Variables interpolées côté backend (`internal/mail/webhooks/executor.go`). */
export const WEBHOOK_TEMPLATE_VARIABLE_GROUPS: WebhookTemplateVariableGroup[] = [
{
id: "sender",
label: "Expéditeur",
description: "Identité de l'expéditeur du message déclencheur.",
variables: [
{
token: "$sender.name",
label: "Nom",
description: "Nom affiché de l'expéditeur.",
example: "Alice Example",
},
{
token: "$sender.email",
label: "E-mail",
description: "Adresse e-mail de l'expéditeur.",
example: "alice@example.com",
},
],
},
{
id: "message",
label: "Message",
description: "Métadonnées principales du mail.",
variables: [
{
token: "$subject",
label: "Objet",
description: "Objet du message.",
example: "Hello World",
},
{
token: "$message_id",
label: "Identifiant",
description: "Identifiant interne Ultimail du message.",
example: "msg-123",
},
{
token: "$date",
label: "Date",
description: "Date de réception au format ISO 8601.",
example: "2026-05-22T10:00:00Z",
},
],
},
{
id: "body",
label: "Contenu",
description: "Corps du message, en texte ou HTML.",
variables: [
{
token: "$body.textContent",
label: "Texte brut",
description: "Corps du message sans mise en forme.",
example: "Plain body",
},
{
token: "$body.htmlContent",
label: "HTML",
description: "Corps du message avec balises HTML.",
example: "<p>HTML body</p>",
},
],
},
{
id: "recipients",
label: "Destinataires",
description: "Adresses en copie directe (To).",
variables: [
{
token: "$recipients.to",
label: "To",
description: "Liste des destinataires, séparés par des virgules.",
example: "bob@example.com, carol@example.com",
},
],
},
]
export const WEBHOOK_TEMPLATE_VARIABLES = WEBHOOK_TEMPLATE_VARIABLE_GROUPS.flatMap(
(group) => group.variables
)