Documentation ¶
Index ¶
- Constants
- type MailTemplate
- type Mailer
- func (m *Mailer) Mail(to, subjectTemplate, templateURL, defaultTemplate string, ...) error
- func (m *Mailer) MailBody(url string, defaultTemplate string, data map[string]interface{}) (string, error)
- func (m *Mailer) MailWithAlternative(to, subjectTemplate string, templateURL string, defaultTemplate string, ...) error
- type TemplateCache
Constants ¶
View Source
const TemplateExpiration = 10 * time.Second
TemplateExpiration is the time period that the template will be cached for
View Source
const TemplateRetries = 3
TemplateRetries is the amount of time MailMe will try to fetch a URL before giving up
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MailTemplate ¶
type MailTemplate struct {
// contains filtered or unexported fields
}
type Mailer ¶
type Mailer struct { From string Host string Port int User string Pass string BaseURL string FuncMap template.FuncMap Logger logrus.FieldLogger // contains filtered or unexported fields }
Mailer lets MailMe send templated mails
func (*Mailer) Mail ¶
func (m *Mailer) Mail(to, subjectTemplate, templateURL, defaultTemplate string, templateData map[string]interface{}) error
Mail sends a templated mail. It will try to load the template from a URL, and otherwise fall back to the default
func (*Mailer) MailWithAlternative ¶
func (m *Mailer) MailWithAlternative(to, subjectTemplate string, templateURL string, defaultTemplate string, plainTemplateURL string, plainDefaultTemplate string, templateData map[string]interface{}) error
Mail sends a templated mail. It will try to load the template from a URL, and otherwise fall back to the default
type TemplateCache ¶
type TemplateCache struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.