From e9b628cd3fa5df070b52e4d289464e9436ec15c0 Mon Sep 17 00:00:00 2001 From: Arminas Date: Fri, 30 Dec 2022 20:26:23 +0200 Subject: [PATCH] Minor fixes Minor fixes --- emailer/smtp.go | 6 +++--- handler/routes.go | 1 - templates/email_settings.html | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/emailer/smtp.go b/emailer/smtp.go index dc2cac5..d1fdbae 100644 --- a/emailer/smtp.go +++ b/emailer/smtp.go @@ -20,7 +20,7 @@ type SmtpMail struct { from string } -func AuthType(authType string) mail.AuthType { +func authType(authType string) mail.AuthType { switch strings.ToUpper(authType) { case "PLAIN": return mail.AuthPlain @@ -31,7 +31,7 @@ func AuthType(authType string) mail.AuthType { } } -func EncryptionType(encryptionType string) mail.Encryption { +func encryptionType(encryptionType string) mail.Encryption { switch strings.ToUpper(encryptionType) { case "SSL": return mail.EncryptionSSL @@ -45,7 +45,7 @@ func EncryptionType(encryptionType string) mail.Encryption { } func NewSmtpMail(hostname string, port int, username string, password string, noTLSCheck bool, auth string, fromName, from string, encryption string) *SmtpMail { - ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: AuthType(auth), encryption: EncryptionType(encryption)} + ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: authType(auth), encryption: encryptionType(encryption)} return &ans } diff --git a/handler/routes.go b/handler/routes.go index 403bda3..92c0191 100644 --- a/handler/routes.go +++ b/handler/routes.go @@ -522,7 +522,6 @@ func EmailClient(db store.IStore) echo.HandlerFunc { emailSetting.DefaultEmailContent, attachments, ) - fmt.Println("\n\n\n %s \n\n\n", err) if err != nil { return c.JSON(http.StatusInternalServerError, jsonHTTPResponse{false, err.Error()}) diff --git a/templates/email_settings.html b/templates/email_settings.html index 4af81d6..5fecb59 100644 --- a/templates/email_settings.html +++ b/templates/email_settings.html @@ -70,7 +70,7 @@ Email Settings
-