POST /marketplace/messaging/send-email — email transaccional con plantilla o HTML inline
fromSenderId.fromEmail.fromEmail ni fromSenderId, la API usa el remitente por defecto del proveedor de mensajería (variables de entorno del servidor, p. ej. MS_PROVIDER_FROM_EMAIL / MS_PROVIDER_FROM_NAME, con respaldo tipo SENDGRID_FROM_* o noreply@gueno.com + Güeno). Eso es el comportamiento esperado, no un error.
{{placeholders}} en asunto, HTML, texto o plantilla. Por defecto {}.htmlBody ni textBody.
templateId.
{{variables}} con templateParams.htmlBody o textBody.
{ "success": false, "error": "<mensaje en inglés>" }. Los cuerpos inválidos pueden devolver otro formato (p. ej. detalle Zod) con 400. Todos los error de negocio van en inglés.
| Situación | HTTP | Ejemplo de error (texto real de la API) |
|---|---|---|
| Integración Email desactivada para la org | 400 | Email integration is not active. Enable Email (global_sender_email) in Applications (Marketplace) for this organization. |
| Servidor sin URL del proveedor de mensajería | 400 | MS_PROVIDER_URL is not configured on the server. Configure the messaging provider to send email. |
| Precio > 0 y sin saldo ni cupo de pack | 400 | Insufficient balance for this send (cost … credits). … (ver respuesta completa) |
| Envío OK pero fallo al registrar cobro | 400 | Insufficient balance to record billing for this send. Current balance (…) is below required (…). … |
templateId y cuerpo inline a la vez | 400 (validación) | Use either templateId + templateParams, or htmlBody/textBody only — not both. |
| Sin plantilla ni cuerpo | 400 (validación) | Provide templateId or htmlBody/textBody. |
Modo inline sin subject | 400 (validación) | subject is required when not using a template. |
| Plantilla inexistente u otra organización | 404 | Template not found or not accessible for this organization. |
| Plantilla con otro canal (no email) | 400 | Template channel is "<channel>"; email is required. |
| Plantilla sin asunto tras variables | 400 | The template has no subject or it is empty after replacing variables. Send subject in the request body or set the subject on the template. |
fromSenderId y fromEmail juntos | 400 | Send only one of fromSenderId or fromEmail, not both. |
fromSenderId desconocido | 400 | fromSenderId does not match a sender for this organization. Check Settings → Email → Senders. |
Dominio del fromEmail no registrado | 400 | Domain "…" is not registered in Güeno. Add and verify it under Settings → Email → Domains before using sender "…". |
| Dominio sin verificar | 400 | Domain "…" is not verified yet. Complete DNS records and click Verify under Settings → Email → Domains. |
| Dominio OK pero remitente no dado de alta | 400 | Sender "…" is not configured. Add it under Settings → Email → Senders (domain "…" is already verified). |
Asunto vacío tras {{…}} (inline) | 400 | Subject is empty after replacing variables. |
| Cuerpo vacío tras render | 400 | htmlBody or textBody is empty after rendering. |
| Sin organización en sesión | 401 | { "error": "Organization ID not found" } (sin campo success) |
{ "success": false, "error": "…" } con 200; comprueba siempre success y error.