cfdf515228
- .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>
1.8 KiB
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. |
|
false |
|
|
EmailMessagePy inmutable con from_addr, to (como tupla), subject y body_html; body_text vacio | true |
|
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.