export testing

This commit is contained in:
Your Name 2024-01-02 10:13:52 -05:00
parent bdfa19c7ec
commit d1f7dcba1b
2 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,7 @@ import (
"time"
)
//
func SendRegistrationEmail(recipient, username, password string) bool {
data := struct {
SiteName string
@ -64,6 +65,7 @@ func SendAlertEmail(username, recipient, message string) bool {
return true
}
func SendRecoveryEmail(recipient, username, code string) bool {
data := struct {
SiteName string
@ -91,6 +93,7 @@ func SendRecoveryEmail(recipient, username, code string) bool {
return true
}
//
func Send2faEmail(recipient, fullname, code string) error {
data := struct {
SiteName string
@ -153,6 +156,7 @@ func SendMail(addr, from, subject, body string, to string) error {
return c.Quit()
}
//
func SendAlert(u int64, subject, body string) error {
user, ok := GetById(u)
if !ok {

View File

@ -24,7 +24,7 @@ type config struct {
Templates templates
SMTPServer string
db *sqlx.DB
testing bool
Testing bool
TablePrefix string
}
@ -95,7 +95,7 @@ func Register(username, email, ip string) bool {
log.Printf("scsusers.Register: insert failed: %s\n", err.Error())
return false
}
if c.testing {
if c.Testing {
return true
}
if SendRegistrationEmail(email, username, string(pass)) {