Restructure email sending

smtp and mailgun now implement an emailClient interface, which the
Emailer can use.
This commit is contained in:
Harvey Tindall
2020-09-13 21:07:15 +01:00
parent 831296a3e8
commit 51839b5942
5 changed files with 120 additions and 84 deletions
+2 -4
View File
@@ -53,7 +53,7 @@ type appContext struct {
timePattern string
storage Storage
validator Validator
email Emailer
email *Emailer
info, debug, err *log.Logger
host string
port int
@@ -361,8 +361,6 @@ func start(asDaemon, firstCall bool) {
}
app.validator.init(validatorConf)
app.email.init(app)
inviteDaemon := NewRepeater(time.Duration(60*time.Second), app)
go inviteDaemon.Run()
@@ -476,7 +474,7 @@ func main() {
folder = os.Getenv("TEMP")
}
SOCK = filepath.Join(folder, SOCK)
fmt.Println(SOCK)
fmt.Println("Socket:", SOCK)
if flagPassed("start") {
args := []string{}
for i, f := range os.Args {