sendmail: remove organization

Signed-off-by: Nicolas Froger <nicolas@kektus.xyz>
This commit is contained in:
Nicolas Froger 2022-08-15 23:38:47 +02:00
parent c9f97d5e70
commit 7b340cc6f4
Signed by: nicolas
GPG Key ID: 461D87623FDF1E47
2 changed files with 15 additions and 19 deletions

View File

@ -17,10 +17,10 @@ limitations under the License.
package main package main
import ( import (
"log"
"net/http" "net/http"
"os" "os"
"time" "time"
"log"
"github.com/spf13/viper" "github.com/spf13/viper"
) )

View File

@ -22,12 +22,12 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"html/template" "html/template"
"log"
"net" "net"
"net/http" "net/http"
"net/smtp" "net/smtp"
"net/url" "net/url"
"strings" "strings"
"log"
"github.com/dpapathanasiou/go-recaptcha" "github.com/dpapathanasiou/go-recaptcha"
"github.com/spf13/viper" "github.com/spf13/viper"
@ -220,13 +220,11 @@ func SendMail(httpResp http.ResponseWriter, httpReq *http.Request) {
httpReq.ParseForm() httpReq.ParseForm()
contactRequest := ContactRequest{ contactRequest := ContactRequest{
Name: httpReq.FormValue("name"), Name: httpReq.FormValue("name"),
Email: strings.TrimSpace(httpReq.FormValue("email")), Email: strings.TrimSpace(httpReq.FormValue("email")),
Organization: httpReq.FormValue("organization"), Subject: httpReq.FormValue("subject"),
Subject: httpReq.FormValue("subject"), Message: httpReq.FormValue("message"),
Message: httpReq.FormValue("message"), OriginURI: httpReq.FormValue("requestOrigin"),
RequestTarget: httpReq.FormValue("target"),
OriginURI: httpReq.FormValue("requestOrigin"),
} }
recipients := []string{viper.GetString("CONTACT_REPLY_BCC_EMAIL")} 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)) log.Println("New Request:", string(userData))
templateData := struct { templateData := struct {
Name string Name string
Email string Email string
Organization string Subject string
Subject string Message string
Message string
}{ }{
Name: contactRequest.Name, Name: contactRequest.Name,
Email: contactRequest.Email, Email: contactRequest.Email,
Organization: contactRequest.Organization, Subject: contactRequest.Subject,
Subject: contactRequest.Subject, Message: contactRequest.Message,
Message: contactRequest.Message,
} }
replyTplFile := viper.GetString("TEMPLATE_CONTACT_REQUEST_REPLY") replyTplFile := viper.GetString("TEMPLATE_CONTACT_REQUEST_REPLY")