Documentation
¶
Index ¶
- Variables
- func Templates(locale string) templateSet
- type CredentialExpiryParams
- type FlightReviewExpiryParams
- type FlightReviewRequiredParams
- type PassengerCurrencyParams
- type RatingExpiryParams
- type RevalidationParams
- type SMTPConfig
- type Sender
- type SignatureCompletedParams
- type SignatureRequestParams
- type VerifyEmailParams
Constants ¶
This section is empty.
Variables ¶
var ( // EmailSendTotal counts email send attempts by result. // Results: success, failure, dry_run, invalid_address. EmailSendTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "email_send_total", Help: "Total number of email send attempts.", }, []string{"result"}, ) // EmailSendDurationSeconds tracks SMTP send latency for delivered emails. EmailSendDurationSeconds = prometheus.NewHistogram( prometheus.HistogramOpts{ Name: "email_send_duration_seconds", Help: "Latency of the SMTP send call in seconds (both successful and failed attempts).", Buckets: prometheus.DefBuckets, }, ) )
Functions ¶
Types ¶
type CredentialExpiryParams ¶
type PassengerCurrencyParams ¶
type RatingExpiryParams ¶
type RevalidationParams ¶
type SMTPConfig ¶
SMTPConfig holds SMTP server configuration
func LoadSMTPConfig ¶
func LoadSMTPConfig() *SMTPConfig
LoadSMTPConfig loads SMTP configuration from environment variables
func (*SMTPConfig) IsConfigured ¶
func (c *SMTPConfig) IsConfigured() bool
IsConfigured returns true if SMTP is properly configured
type Sender ¶
type Sender struct {
// contains filtered or unexported fields
}
Sender sends emails via SMTP
func NewSender ¶
func NewSender(config *SMTPConfig) *Sender
NewSender creates a new SMTP email sender
func (*Sender) IsConfigured ¶ added in v1.2.6
IsConfigured returns true when the sender has a usable SMTP configuration.
func (*Sender) Send ¶
Send sends an email.
The recipient is validated with net/mail.ParseAddress (which rejects CR/LF and other header-injection vectors) and is delivered only through the SMTP envelope (the RCPT TO argument of smtp.SendMail). The user-controlled recipient is never concatenated into the message DATA headers, so it cannot be used to inject additional headers (CWE-640). The subject is MIME Q-encoded so any non-ASCII or control bytes are escaped and cannot break out of the Subject header.