Documentation
¶
Overview ¶
Package email provides a Mailgun-backed email sender for transactional email delivery. It is intentionally dependency-free beyond the Go standard library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
Attachment describes a file to attach to an email. Data is raw file bytes.
type EmailMessage ¶
type EmailMessage struct {
From string
To []string
CC []string
BCC []string
Subject string
Text string
HTML string
Attachments []Attachment
}
EmailMessage represents an email to be sent.
type MailgunClient ¶
type MailgunClient struct {
// contains filtered or unexported fields
}
MailgunClient sends emails via the Mailgun API.
func NewMailgunClient ¶
func NewMailgunClient(endpoint, user, password string) *MailgunClient
NewMailgunClient creates a MailgunClient from plain credentials. The returned client uses a dedicated http.Client with a 30-second timeout and connection pooling.
func (*MailgunClient) Send ¶
func (c *MailgunClient) Send(ctx context.Context, msg *EmailMessage) (string, error)
Send posts the email to Mailgun.
Click to show internal directories.
Click to hide internal directories.