Documentation
¶
Index ¶
Constants ¶
View Source
const ( MailProviderDev = "dev" MailProviderSES = "ses" MailProviderLocal = "local" )
Variables ¶
This section is empty.
Functions ¶
func BuildRawEmail ¶ added in v1.6.2
func BuildRawEmail(data SendMailData) ([]byte, error)
BuildRawEmail constructs a raw MIME email message from SendMailData. This is shared across all email implementations (Dev, SES, etc.) to ensure consistent email formatting and support for attachments and transactional flags.
func ExtractEmailAddress ¶ added in v1.6.2
ExtractEmailAddress extracts the email address from a formatted string like "Name <email@example.com>" or returns the input if it's already just an email address
Types ¶
type Attachment ¶ added in v1.6.2
type Attachment struct {
URL string `json:"url"` // URL where the attachment was fetched from
Body []byte `json:"body"` // Raw bytes of the attachment
ContentType string `json:"contentType"` // MIME type of the attachment
Filename string `json:"filename"` // Name of the file
}
Attachment represents an email attachment
type Local ¶ added in v1.6.2
type Local struct{}
func (Local) Send ¶ added in v1.6.2
func (Local) Send(data SendMailData) error
type Mailer ¶ added in v1.4.1
type Mailer interface {
// Send sends the email
Send(SendMailData) error
}
Mailer is used to have different implementation for sending email
type SendMailData ¶ added in v1.4.1
type SendMailData struct {
From string `json:"from"`
FromName string `json:"fromName"`
To string `json:"to"`
ToName string `json:"toName"`
Subject string `json:"subject"`
HTMLBody string `json:"htmlBody"`
TextBody string `json:"textBody"`
ReplyTo string `json:"replyTo"`
Body string `json:"body"`
Attachments []Attachment `json:"attachments"`
IsTransactional bool `json:"isTransactional"`
}
SendMailData contains necessary fields to send an email
Click to show internal directories.
Click to hide internal directories.