Plantilla de Email
Una Plantilla de Email define contenido reutilizable con variables ({{variable}}).
Schema
interface EmailTemplate {
id: string; // "emt_..." - Identificador único
account_id: string; // Cuenta propietaria
name: string; // Nombre
event_type: string; // Evento (ej. "user_welcome")
editor: "grapesjs_mjml"; // Editor
editor_state: string; // Estado serializado
mjml: string; // MJML fuente
subject_template: string;
body_text_template: string;
body_html_template: string;
archived_at: string | null;
}
Propiedades
| Propiedad | Tipo | Descripción |
|---|---|---|
id | string | KSUID con prefijo emt |
account_id | string | Cuenta propietaria |
name | string | Nombre legible |
event_type | string | Evento de negocio |
editor | string | Tipo de editor |
editor_state | string | Estado del editor |
mjml | string | Fuente MJML |
subject_template | string | Asunto |
body_text_template | string | Cuerpo texto |
body_html_template | string | Cuerpo HTML |
archived_at | string? | Fecha de archivado |
Sintaxis de variables
Usa {{variable_name}}:
Subject: Welcome, {{name}}!
Dear {{name}},
Your account {{account_name}} is ready.
Ejemplo
{
"id": "emt_2kHfPZcN9xW4mE8RtY7vB",
"account_id": "acc_1jGePYbM8wV3lD7QsX6uA",
"name": "welcome",
"event_type": "user_welcome",
"editor": "grapesjs_mjml",
"editor_state": "{}",
"mjml": "<mjml><mj-body></mj-body></mjml>",
"subject_template": "Welcome to {{company}}, {{name}}!",
"body_text_template": "Hi {{name}},\n\nWelcome to {{company}}...",
"body_html_template": "<h1>Welcome, {{name}}!</h1>...",
"archived_at": null
}
Relacionado
- Email Message - Mensajes enviados
- Email - Infraestructura