53deb8e9a8
Tipos: EmailAttachment, EmailMessage, SMTPConfig. Puras: email_build_html, email_build_text, email_with_attachment, email_template_render. Impuras: smtp_connect (TLS/STARTTLS/plain), smtp_send (MIME multipart con adjuntos). Solo stdlib: net/smtp, crypto/tls, text/template, mime/multipart. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.5 KiB
1.5 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 | go | infra | 1.0.0 | pure | func EmailBuildHTML(from string, to []string, subject, bodyHTML string) EmailMessage | Construye un EmailMessage con cuerpo HTML. Retorna una nueva estructura sin CC, BCC, adjuntos ni headers custom. |
|
|
|
false |
|
EmailMessage listo para enviar con cuerpo HTML | true |
|
functions/infra/email_build_test.go | functions/infra/email_build_html.go |
Ejemplo
msg := EmailBuildHTML(
"alice@example.com",
[]string{"bob@example.com", "carol@example.com"},
"Reporte mensual",
"<h1>Hola</h1><p>Ver adjunto.</p>",
)
// msg.BodyHTML = "<h1>Hola</h1><p>Ver adjunto.</p>"
// msg.BodyText = ""
Notas
Funcion pura. Copia el slice to para evitar aliasing con el caller. Para anadir adjuntos usar EmailWithAttachment. Para texto plano usar EmailBuildText.