diff --git a/main.go b/main.go index e2d7420..03ea4d8 100644 --- a/main.go +++ b/main.go @@ -17,10 +17,10 @@ limitations under the License. package main import ( + "log" "net/http" "os" "time" - "log" "github.com/spf13/viper" ) diff --git a/sendmail.go b/sendmail.go index e642d7f..51f5eeb 100644 --- a/sendmail.go +++ b/sendmail.go @@ -22,12 +22,12 @@ import ( "encoding/json" "fmt" "html/template" + "log" "net" "net/http" "net/smtp" "net/url" "strings" - "log" "github.com/dpapathanasiou/go-recaptcha" "github.com/spf13/viper" @@ -220,13 +220,11 @@ func SendMail(httpResp http.ResponseWriter, httpReq *http.Request) { httpReq.ParseForm() contactRequest := ContactRequest{ - Name: httpReq.FormValue("name"), - Email: strings.TrimSpace(httpReq.FormValue("email")), - Organization: httpReq.FormValue("organization"), - Subject: httpReq.FormValue("subject"), - Message: httpReq.FormValue("message"), - RequestTarget: httpReq.FormValue("target"), - OriginURI: httpReq.FormValue("requestOrigin"), + Name: httpReq.FormValue("name"), + Email: strings.TrimSpace(httpReq.FormValue("email")), + Subject: httpReq.FormValue("subject"), + Message: httpReq.FormValue("message"), + OriginURI: httpReq.FormValue("requestOrigin"), } recipients := []string{viper.GetString("CONTACT_REPLY_BCC_EMAIL")} @@ -235,17 +233,15 @@ func SendMail(httpResp http.ResponseWriter, httpReq *http.Request) { log.Println("New Request:", string(userData)) templateData := struct { - Name string - Email string - Organization string - Subject string - Message string + Name string + Email string + Subject string + Message string }{ - Name: contactRequest.Name, - Email: contactRequest.Email, - Organization: contactRequest.Organization, - Subject: contactRequest.Subject, - Message: contactRequest.Message, + Name: contactRequest.Name, + Email: contactRequest.Email, + Subject: contactRequest.Subject, + Message: contactRequest.Message, } replyTplFile := viper.GetString("TEMPLATE_CONTACT_REQUEST_REPLY")