feat: tipos y funciones email SMTP en Go (infra)
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>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package infra
|
||||
|
||||
// EmailBuildHTML constructs an EmailMessage with an HTML body.
|
||||
// to is a list of recipient addresses.
|
||||
// subject is the email subject line.
|
||||
// bodyHTML is the HTML content of the email.
|
||||
// Returns a new EmailMessage with no CC, BCC, attachments or custom headers.
|
||||
func EmailBuildHTML(from string, to []string, subject, bodyHTML string) EmailMessage {
|
||||
toSlice := make([]string, len(to))
|
||||
copy(toSlice, to)
|
||||
return EmailMessage{
|
||||
From: from,
|
||||
To: toSlice,
|
||||
Subject: subject,
|
||||
BodyHTML: bodyHTML,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user