Documentation
¶
Index ¶
- func RegisterDriver(name string, factory func() (Mailer, error))
- func Reinitialize() error
- func ReinitializeWithDriver(driver string) error
- func Send(ctx context.Context, msg *Message) error
- func SetDefaultMailer(mailer Mailer)
- type Address
- type Attachment
- type Mailer
- type Manager
- func (m *Manager) Broadcast(ctx context.Context, channels []string, msg *Message) error
- func (m *Manager) Channel(name string) Mailer
- func (m *Manager) ClearChannels()
- func (m *Manager) GetChannels() []string
- func (m *Manager) HasChannel(name string) bool
- func (m *Manager) RemoveChannel(name string)
- func (m *Manager) Send(ctx context.Context, channel string, msg *Message) error
- func (m *Manager) SetChannel(name string, mailer Mailer)
- type Message
- func (m *Message) AttachData(data []byte, name, contentType string) *Message
- func (m *Message) AttachFile(path string) *Message
- func (m *Message) BCC(email string, name ...string) *Message
- func (m *Message) Body(body string) *Message
- func (m *Message) CC(email string, name ...string) *Message
- func (m *Message) From(email string, name ...string) *Message
- func (m *Message) GetAttachments() []Attachment
- func (m *Message) GetBCC() []Address
- func (m *Message) GetCC() []Address
- func (m *Message) GetFrom() Address
- func (m *Message) GetHTMLBody() string
- func (m *Message) GetHeaders() map[string]string
- func (m *Message) GetPriority() Priority
- func (m *Message) GetReplyTo() []Address
- func (m *Message) GetSubject() string
- func (m *Message) GetTextBody() string
- func (m *Message) GetTo() []Address
- func (m *Message) HTMLBody(body string) *Message
- func (m *Message) Header(key, value string) *Message
- func (m *Message) Priority(priority Priority) *Message
- func (m *Message) ReplyTo(email string, name ...string) *Message
- func (m *Message) Send() error
- func (m *Message) SendWithContext(ctx context.Context) error
- func (m *Message) Subject(subject string) *Message
- func (m *Message) Template(name string, data interface{}) *Message
- func (m *Message) TextBody(body string) *Message
- func (m *Message) To(email string, name ...string) *Message
- type Priority
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDriver ¶
RegisterDriver allows drivers to register themselves
func Reinitialize ¶
func Reinitialize() error
Reinitialize reinitializes the mail driver (useful after config changes)
func ReinitializeWithDriver ¶
ReinitializeWithDriver reinitializes with a specific driver
func SetDefaultMailer ¶
func SetDefaultMailer(mailer Mailer)
SetDefaultMailer sets the default mailer
Types ¶
type Attachment ¶
Attachment represents an email attachment
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages multiple mail channels
func (*Manager) ClearChannels ¶
func (m *Manager) ClearChannels()
ClearChannels removes all channels
func (*Manager) GetChannels ¶
GetChannels returns all channel names
func (*Manager) HasChannel ¶
HasChannel checks if a channel exists
func (*Manager) RemoveChannel ¶
RemoveChannel removes a channel
func (*Manager) SetChannel ¶
SetChannel sets a specific mailer for a channel
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message represents an email message
func (*Message) AttachData ¶
AttachData attaches data from memory
func (*Message) AttachFile ¶
AttachFile attaches a file from the filesystem
func (*Message) GetAttachments ¶
func (m *Message) GetAttachments() []Attachment
GetAttachments returns the attachments
func (*Message) GetHTMLBody ¶
GetHTMLBody returns the HTML body
func (*Message) GetHeaders ¶
GetHeaders returns the custom headers
func (*Message) GetPriority ¶
GetPriority returns the priority
func (*Message) GetReplyTo ¶
GetReplyTo returns the reply-to addresses
func (*Message) GetTextBody ¶
GetTextBody returns the plain text body
func (*Message) SendWithContext ¶
SendWithContext sends the message using the default mailer with context
Directories
¶
| Path | Synopsis |
|---|---|
|
Package alldrivers imports all mail drivers to register them Import this package with _ to ensure all drivers are registered
|
Package alldrivers imports all mail drivers to register them Import this package with _ to ensure all drivers are registered |