Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ConfirmEmailTemplateEN *template.Template = template.Must(template.New("confirmEmailTemplateSrcEN").Parse(confirmEmailTemplateSrcEN))
var OutgoingEmailsChannel chan *Email
OutgoingEmailsChannel is a light-weight go-routine to send emails
var RequestPasswordTokenTemailTemplateEN *template.Template = template.Must(template.New("requestPasswordTokenTemailTemplateSrcEN").Parse(requestPasswordTokenTemailTemplateSrcEN))
var TerminalMail = NewTerminalMailer()
TerminalMail is ready-to-use instance for displaying emails in the terminal
var VoidMail = NewVoidMailer()
VoidMail is ready-to-use instance for dropping outgoing emails
Functions ¶
func BackgroundSend ¶
func BackgroundSend(emails <-chan *Email)
BackgroundSend will send emails enqueued in a channel
Types ¶
type Email ¶
Email contains all information to use sendmail
type Emailer ¶
Emailer any object that can send
var DefaultMail Emailer
DefaultMail is the default instance used by infomark
type SendMailer ¶
type SendMailer struct {
Binary string
}
SendMailer uses the sendmail binary to send emails.
var SendMail *SendMailer
SendMail is ready-to-use instance for sendmail
func NewSendMailer ¶
func NewSendMailer(sendmailBinary string) *SendMailer
NewSendMailer creates an object that will send emails over sendmail
func (*SendMailer) Send ¶
func (sm *SendMailer) Send(e *Email) error
Send uses `sendmail` to deliver emails.
type TerminalMailer ¶
type TerminalMailer struct{}
TerminalMailer prints the email to the terminal.
func NewTerminalMailer ¶
func NewTerminalMailer() *TerminalMailer
NewTerminalMailer creates an object that printout the email in the terminal
func (*TerminalMailer) Send ¶
func (sm *TerminalMailer) Send(e *Email) error
Send prints everything to stdout.
type VoidMailer ¶
type VoidMailer struct{}
VoidMailer does nothing (to keep the unit test outputs clean)
func NewVoidMailer ¶
func NewVoidMailer() *VoidMailer
NewVoidMailer creates an object that drops any email
func (*VoidMailer) Send ¶
func (sm *VoidMailer) Send(e *Email) error
Send will drop any outgoing email