From 1dcb3e80c4bd617193766ab501e49a82b9856e77 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 23 Jul 2020 18:12:44 -0400 Subject: [PATCH] lets enable alert emails --- main.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 7615024..1107a1c 100644 --- a/main.go +++ b/main.go @@ -90,7 +90,7 @@ func Register(username, email, ip string) bool { log.Printf("scsusers.Register: insert failed: %s\n", err.Error()) return false } - if sendRegistrationEmail(email, username, string(pass)) { + if SendRegistrationEmail(email, username, string(pass)) { log.Printf("scsusers.Register: New user registration: %s from %s\n", username, ip) return true } @@ -282,7 +282,7 @@ func RecoverByUsername(username string) { qq := fmt.Sprintf("update %s_auth set recoverycode=$1, recoverytime=NOW() where username = $2", c.TablePrefix) _, err := c.db.Exec(qq, recoverycode, username) if err == nil { - sendRecoveryEmail(email, username, string(recoverycode)) + SendRecoveryEmail(email, username, string(recoverycode)) } } } @@ -296,7 +296,7 @@ func RecoverByEmail(e string) { qq := fmt.Sprintf("update %s_auth set recoverycode=$1, recoverytime=NOW() where username = $2", c.TablePrefix) _, err := c.db.Exec(qq, recoverycode, username) if err == nil { - sendRecoveryEmail(email, username, string(recoverycode)) + SendRecoveryEmail(email, username, string(recoverycode)) } } } @@ -310,7 +310,7 @@ func randBytes(n int) []byte { return []byte(base32.StdEncoding.EncodeToString(randomBytes)[:n]) } -func sendRegistrationEmail(recipient, username, password string) bool { +func SendRegistrationEmail(recipient, username, password string) bool { data := struct { SiteName string FromEmail string @@ -337,7 +337,7 @@ func sendRegistrationEmail(recipient, username, password string) bool { return true } -func sendAlertEmail(username, recipient, message string) bool { +func SendAlertEmail(username, recipient, message string) bool { data := struct { SiteName string FromEmail string @@ -365,7 +365,7 @@ func sendAlertEmail(username, recipient, message string) bool { return true } -func sendRecoveryEmail(recipient, username, code string) bool { +func SendRecoveryEmail(recipient, username, code string) bool { data := struct { SiteName string FromEmail string