now use contact person's email in from
This commit is contained in:
parent
6234d56f8b
commit
13b686b3a3
17
sendmail.go
17
sendmail.go
|
@ -253,29 +253,30 @@ func SendMail(httpResp http.ResponseWriter, httpReq *http.Request) {
|
||||||
Message: contactRequest.Message,
|
Message: contactRequest.Message,
|
||||||
DemoURL: viper.GetString("DEMO_URL"),
|
DemoURL: viper.GetString("DEMO_URL"),
|
||||||
}
|
}
|
||||||
contactResponse := ContactResponse{}
|
|
||||||
contactEmail := viper.GetString("CONTACT_REPLY_EMAIL")
|
|
||||||
|
|
||||||
sendMailReq := NewSendMailRequest(
|
|
||||||
contactEmail,
|
|
||||||
recipients,
|
|
||||||
contactRequest.Subject,
|
|
||||||
)
|
|
||||||
|
|
||||||
replyTplFile := ""
|
replyTplFile := ""
|
||||||
|
contactEmail := viper.GetString("CONTACT_REPLY_EMAIL")
|
||||||
if contactRequest.RequestTarget == "demo" {
|
if contactRequest.RequestTarget == "demo" {
|
||||||
replyTplFile = viper.GetString("TEMPLATE_DEMO_REQUEST_REPLY")
|
replyTplFile = viper.GetString("TEMPLATE_DEMO_REQUEST_REPLY")
|
||||||
if replyTplFile == "" {
|
if replyTplFile == "" {
|
||||||
replyTplFile = "./templates/template_reply_demo_request.html"
|
replyTplFile = "./templates/template_reply_demo_request.html"
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
contactEmail = contactRequest.Email
|
||||||
replyTplFile = viper.GetString("TEMPLATE_CONTACT_REQUEST_REPLY")
|
replyTplFile = viper.GetString("TEMPLATE_CONTACT_REQUEST_REPLY")
|
||||||
if replyTplFile == "" {
|
if replyTplFile == "" {
|
||||||
replyTplFile = "./templates/template_reply_contact_request.html"
|
replyTplFile = "./templates/template_reply_contact_request.html"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendMailReq := NewSendMailRequest(
|
||||||
|
contactEmail,
|
||||||
|
recipients,
|
||||||
|
contactRequest.Subject,
|
||||||
|
)
|
||||||
err := sendMailReq.ParseTemplate(replyTplFile, templateData)
|
err := sendMailReq.ParseTemplate(replyTplFile, templateData)
|
||||||
|
|
||||||
|
contactResponse := ContactResponse{}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err := sendMailReq.Execute()
|
err := sendMailReq.Execute()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue