Files
fn_registry/python/functions/infra/email_build_html.md
T
egutierrez cfdf515228 chore: auto-commit (799 archivos)
- .claude/CLAUDE.md
- .claude/commands/subagentes.md
- .claude/rules/INDEX.md
- .mcp.json
- bash/functions/cybersecurity/analyze_dns.md
- bash/functions/cybersecurity/audit_http_headers.md
- bash/functions/cybersecurity/audit_ssh_config.md
- bash/functions/cybersecurity/check_firewall.md
- bash/functions/cybersecurity/detect_suspicious_users.md
- bash/functions/cybersecurity/encrypt_file.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 00:28:20 +02:00

1.8 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path
email_build_html function py infra 1.0.0 pure email_build_html(from_addr: str, to: list[str], subject: str, body_html: str) -> EmailMessagePy Construye un EmailMessagePy inmutable con cuerpo HTML. El campo body_text queda vacio. Funcion pura sin efectos secundarios.
email
html
builder
pure
python
dataclass
pendiente-usar
false
dataclasses
name desc
from_addr direccion del remitente (ej: 'alice@example.com')
name desc
to lista de direcciones de destinatarios principales
name desc
subject asunto del correo
name desc
body_html contenido HTML del cuerpo del mensaje
EmailMessagePy inmutable con from_addr, to (como tupla), subject y body_html; body_text vacio true
construye mensaje html con campos correctos
convierte lista to a tupla inmutable
body_text queda vacio
python/functions/infra/email_build_html_test.py python/functions/infra/email_build_html.py

Ejemplo

from infra.email_build_html import email_build_html

msg = email_build_html(
    from_addr="alice@example.com",
    to=["bob@example.com", "carol@example.com"],
    subject="Reporte mensual",
    body_html="<h1>Hola</h1><p>Ver adjunto.</p>",
)
assert msg.body_html == "<h1>Hola</h1><p>Ver adjunto.</p>"
assert msg.body_text == ""
assert isinstance(msg.to, tuple)

Notas

Funcion pura. EmailMessagePy es un dataclass frozen — inmutable por construccion. La lista to se convierte a tupla para evitar mutacion externa. Para usar con smtp_send, pasar los campos del mensaje como argumentos individuales.