Files
fn_registry/functions/infra/email_with_attachment.md
egutierrez 47fac22230 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.6 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_with_attachment function go infra 1.0.0 pure func EmailWithAttachment(msg EmailMessage, att EmailAttachment) EmailMessage Retorna una copia del EmailMessage con el adjunto añadido al final. No muta el mensaje original.
email
smtp
attachment
immutable
builder
pendiente-usar
EmailMessage_go_infra
EmailAttachment_go_infra
EmailMessage_go_infra
false
name desc
msg mensaje email existente del que se obtiene la copia base
name desc
att adjunto a agregar: nombre, MIME type y datos binarios
nuevo EmailMessage con todos los campos del original mas el adjunto añadido true
agrega adjunto sin mutar el original
multiples adjuntos se acumulan
copia todos los campos del mensaje
functions/infra/email_build_test.go functions/infra/email_with_attachment.go

Ejemplo

msg := EmailBuildHTML("alice@example.com", []string{"bob@example.com"}, "Informe", "<p>Ver adjunto</p>")
att := EmailAttachment{Filename: "report.pdf", ContentType: "application/pdf", Data: pdfBytes}
msg2 := EmailWithAttachment(msg, att)
// len(msg.Attachments) == 0  (original no mutado)
// len(msg2.Attachments) == 1

Notas

Funcion pura. Implementa el patron immutable builder — cada llamada retorna un nuevo EmailMessage con copia profunda de todos los slices y mapas. Se puede encadenar varias veces para agregar multiples adjuntos.