Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmailSender ¶
type EmailSender struct { SendMail func(string, smtp.Auth, string, []string, []byte) error Server Provider Email Email }
EmailSender struct to construct a mailer instance with server/email inputs
func NewEmailSender ¶
func NewEmailSender() *EmailSender
NewEmailSender returns EmailSender struct with smtp.Sendmail
func (EmailSender) SendMessage ¶
func (e EmailSender) SendMessage() error
SendMessage constructs inputs from server/email and send the email message or returns error
type Gmail ¶
type Gmail struct {
ServerConfig
}
Gmail struct specific to Gmail SMTP
func NewGmail ¶
func NewGmail(s ServerConfig) *Gmail
NewGmail returns Gmail struct with destination address/port
type Provider ¶
type Provider interface { GetServer() string GetPort() int GetFullAddress() string GetUsername() string GetPassword() string }
Provider interface interacts with any given sender
type ServerConfig ¶
ServerConfig has SMTP config values
func (ServerConfig) GetFullAddress ¶
func (s ServerConfig) GetFullAddress() string
GetFullAddress return full server/port as string
func (ServerConfig) GetPassword ¶
func (s ServerConfig) GetPassword() string
GetPassword returns SMTP password credential
func (ServerConfig) GetServer ¶
func (s ServerConfig) GetServer() string
GetServer returns SMTP host/server name
func (ServerConfig) GetUsername ¶
func (s ServerConfig) GetUsername() string
GetUsername returns SMTP username credential
type Yahoo ¶
type Yahoo struct {
ServerConfig
}
Yahoo struct specific to Yahoo SMTP
func NewYahoo ¶
func NewYahoo(s ServerConfig) *Yahoo
NewYahoo returns Yahoo struct with destination address/port