Documentation ¶
Index ¶
- Constants
- func BuildMail(from string, to []string, subject string, textTmpl *texttemplate.Template, ...) ([]byte, error)
- func NewConsoleClient(username string, writer io.Writer) *consoleClient
- func NewInMemClient(username string) *inMemClient
- func NewSMTPClient(hostname string, port int, username string, password string) *smtpClient
- type Client
Constants ¶
View Source
const ( ClientTypeSMTP = "smtp" ClientTypeInMemory = "inmem" ClientTypeConsole = "console" )
mail client types.
Variables ¶
This section is empty.
Functions ¶
func BuildMail ¶
func BuildMail( from string, to []string, subject string, textTmpl *texttemplate.Template, htmlTmpl *htmltemplate.Template, tmplData any, ) ([]byte, error)
BuildMail builds multi-line email body using MIME format.
func NewConsoleClient ¶
NewConsoleClient returns a new consoleClient.
func NewInMemClient ¶
func NewInMemClient(username string) *inMemClient
NewInMemClient returns a new inMemClient.
Types ¶
type Client ¶
type Client interface { Send( to []string, subject string, textTmpl *texttemplate.Template, htmlTmpl *htmltemplate.Template, tmplData any, ) error }
Client is used to handle sending of emails.
Click to show internal directories.
Click to hide internal directories.