Documentation ¶
Index ¶
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 ¶
func SafeHTTPClient ¶
SafeHTTPClient returns an http.Client
func SafeRoundtripper ¶
func SafeRoundtripper(trans http.RoundTripper, log logrus.FieldLogger) http.RoundTripper
SafeRoundtripper returns an HTTP Roundtripper with a logger
Types ¶
type MailTemplate ¶
type MailTemplate struct {
// contains filtered or unexported fields
}
MailTemplate is a mail template
type Mailer ¶
Mailer defines the interface a mailer must implement.
func NewMailer ¶
func NewMailer(instanceConfig *config.Configuration) Mailer
NewMailer returns a new mailer
type MailmeMailer ¶
type MailmeMailer struct { From string Host string Port int User string Pass string BaseURL string FuncMap template.FuncMap // contains filtered or unexported fields }
MailmeMailer lets MailMe send templated mails
type TemplateCache ¶
type TemplateCache struct {
// contains filtered or unexported fields
}
TemplateCache caches the requested templates
type TemplateMailer ¶
type TemplateMailer struct { SiteURL string Config *config.Configuration Mailer *MailmeMailer }
TemplateMailer will send mail and use templates from the site for easy mail styling
func (*TemplateMailer) ConfirmationMail ¶ added in v0.2.4
func (m *TemplateMailer) ConfirmationMail(email, password string) error
func (TemplateMailer) ValidateEmail ¶
func (m TemplateMailer) ValidateEmail(email string) error
ValidateEmail returns nil if the email is valid, otherwise an error indicating the reason it is invalid
Click to show internal directories.
Click to hide internal directories.