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 </div> <div class="form-group" style="width: 48%; margin-left: 4%"> <label for="smtp_password">SMTP Password</label> - <input type="text" class="form-control" id="smtp_password" + <input type="password" class="form-control" id="smtp_password" name="smtp_password" placeholder="E.g. *******" value="{{ .emailSettings.SmtpPassword }}"> </div>