updated config varible name

updated config varible name
This commit is contained in:
Rodrigue Chakode 2020-05-17 21:53:56 +02:00
parent 65309da5fb
commit e7cac1bca9
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ env_variables:
SMTP_VERITY_CERT: true
SMTP_CLIENT_USERNAME: "postmaster@example.com"
SMTP_CLIENT_PASSWORD: "postmasterSecretPassWord"
ALLOWED_ORIGINS: "127.0.0.1,example.com"
CONTACT_REPLY_EMAIL: "noreply@example.com"
CONTACT_REPLY_CC_EMAIL: "contact@example.com"
DEMO_URL: "https://demo.example.com/"
CONTACT_REPLY_BCC_EMAIL: "contact@example.com"
DEMO_URL: "https://demo.example.com/"
ALLOWED_ORIGINS: "127.0.0.1,example.com"

View File

@ -188,9 +188,9 @@ func SendMail(httpResp http.ResponseWriter, httpReq *http.Request) {
var recipients []string
switch contactRequest.RequestTarget {
case "demo":
recipients = []string{contactRequest.Email, viper.GetString("CONTACT_REPLY_CC_EMAIL")}
recipients = []string{contactRequest.Email, viper.GetString("CONTACT_REPLY_BCC_EMAIL")}
case "contact":
recipients = []string{viper.GetString("CONTACT_REPLY_CC_EMAIL")}
recipients = []string{viper.GetString("CONTACT_REPLY_BCC_EMAIL")}
default:
log.Infoln("not allowed request type:", contactRequest.RequestTarget)
httpResp.WriteHeader(http.StatusForbidden)
@ -236,7 +236,7 @@ func SendMail(httpResp http.ResponseWriter, httpReq *http.Request) {
if err != nil {
log.Infof("error: %s", err.Error())
contactResponse.Status = "error"
contactResponse.Message = fmt.Sprintf("An internal error occurred, please try later or send us an email at %s.", viper.GetString("CONTACT_REPLY_CC_EMAIL"))
contactResponse.Message = fmt.Sprintf("An internal error occurred, please try later or send us an email at %s.", viper.GetString("CONTACT_REPLY_BCC_EMAIL"))
} else {
contactResponse.Status = "success"
if contactRequest.RequestTarget == "demo" {