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
import (
"log"
"net/http"
"os"
"time"
"log"
"github.com/spf13/viper"
)

View File

@ -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")