1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-03-27 22:01:29 +02:00
authboss/mailer.go
2015-01-16 21:49:44 -08:00

35 lines
498 B
Go

package authboss
import (
"fmt"
"io"
)
type Mailer int
const (
MailerLog Mailer = iota
MailerSMTP
)
func SendEmail(to, from string, msg []byte) {
}
type mailer interface {
Send(to, from string, msg []byte) error
}
type logMailer struct {
writer io.Writer
}
func newLogMailer(w io.Writer) logMailer {
return logMailer{w}
}
func (e logMailer) Send(to, from string, msg []byte) error {
fmt.Fprintf(e.writer, "email sent\n\nto:\t %s\nfrom:\t %s\nmsg: %s", to, from, msg)
return nil
}