Documentation
¶
Index ¶
- Constants
- type Message
- type MessageOption
- func WithBCC(bcc ...string) MessageOption
- func WithCC(cc ...string) MessageOption
- func WithFrom(from string) MessageOption
- func WithHTMLBody(htmlBody string) MessageOption
- func WithSubject(subject string) MessageOption
- func WithTextBody(textBody string) MessageOption
- func WithTo(to ...string) MessageOption
- type MockSender
- type SMTPPlainAuth
- type SMTPSender
- type Sender
Constants ¶
const ( ErrMessageFieldUnset exception.Class = "email; message required field unset" ErrMessageFieldNewlines exception.Class = "email; message field contains newlines" )
Errors
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
From string `json:"from" yaml:"from"`
To []string `json:"to" yaml:"to"`
CC []string `json:"cc" yaml:"cc"`
BCC []string `json:"bcc" yaml:"bcc"`
Subject string `json:"subject" yaml:"subject"`
TextBody string `json:"textBody" yaml:"textBody"`
HTMLBody string `json:"htmlBody" yaml:"htmlBody"`
}
Message is a message to send via. ses.
func ApplyMessageOptions ¶
func ApplyMessageOptions(m Message, options ...MessageOption) Message
ApplyMessageOptions applies options to a message and returns the mutated copy.
type MessageOption ¶
type MessageOption func(m *Message)
MessageOption is a mutator for messages.
func WithBCC ¶
func WithBCC(bcc ...string) MessageOption
WithBCC sets the bcc addresses for a message.
func WithFrom ¶
func WithFrom(from string) MessageOption
WithFrom sets the from address for a message.
func WithHTMLBody ¶
func WithHTMLBody(htmlBody string) MessageOption
WithHTMLBody sets the html body for a message.
func WithSubject ¶
func WithSubject(subject string) MessageOption
WithSubject sets the subject for a message.
func WithTextBody ¶
func WithTextBody(textBody string) MessageOption
WithTextBody sets the text body for a message.
type SMTPPlainAuth ¶
type SMTPPlainAuth struct {
Identity string `json:"identity" yaml:"identity"`
Username string `json:"username" yaml:"username"`
Password string `json:"password" yaml:"password"`
Host string `json:"host" yaml:"host"`
}
SMTPPlainAuth is a auth set for smtp.
func (SMTPPlainAuth) IsZero ¶
func (spa SMTPPlainAuth) IsZero() bool
IsZero returns if the plain auth is unset.
type SMTPSender ¶
type SMTPSender struct {
Host string `json:"host" yaml:"host"`
Port string `json:"port" yaml:"port"`
LocalName string `json:"localname" yaml:"localname"`
PlainAuth SMTPPlainAuth `json:"plainAuth" yaml:"plainAuth"`
}
SMTPSender is a sender for emails over smtp. NOTE: it only supports dialing TLS SMTP servers.
func (SMTPSender) LocalNameOrDefault ¶
func (s SMTPSender) LocalNameOrDefault() string
LocalNameOrDefault returns a property or a default.
func (SMTPSender) PortOrDefault ¶
func (s SMTPSender) PortOrDefault() string
PortOrDefault returns a property or a default.