Documentation ¶
Overview ¶
Package mailer defines interfaces to send and fetch messages. It also provides a simple template engine and transformers to "fix up" line endings for message bodies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attachment ¶
Attachment implements e-mail attachments.
type Envelope ¶
type Envelope struct { Sender mail.Address To []mail.Address Cc []mail.Address Bcc []mail.Address Subject string }
Envelope specifies the e-mail envelope information.
type Fetcher ¶
Fetcher is the interface for retrieving e-mails from the server and storing them as files in the mailbox directory.
type Sender ¶
type Sender interface { Send(e *Envelope, t *Template, name string, data interface{}, attachments ...*Attachment) []error SendHTML(e *Envelope, t *Template, name string, data interface{}, attachments ...*Attachment) []error Errors() []error }
Sender is the interface for generating e-mails and connecting to the server to send them.
type Template ¶
type Template struct { *template.Template // root template // contains filtered or unexported fields }
Template implements a template engine largely copied from https://gist.github.com/logrusorgru/abd846adb521a6fb39c7405f32fec0cf
func NewTemplate ¶
NewTemplate creates a new Template and performs the initial load of all template files that are in the template path. The dir argument is the directory to load templates from. The ext argument is extension of template files. It must include the leading dot. For example, ".gohtml," not "gohtml."