From 980ec79dbad11727251cb48e0995e3baf158e1bc Mon Sep 17 00:00:00 2001 From: Nicolas Froger Date: Mon, 15 Aug 2022 23:37:45 +0200 Subject: [PATCH] sendmail: use EMAIL_SUBJECT variable for subject Signed-off-by: Nicolas Froger --- main.go | 2 +- sendmail.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 13dece4..5f754a5 100644 --- a/main.go +++ b/main.go @@ -74,7 +74,7 @@ func main() { viper.SetDefault("SMTP_CLIENT_PASSWORD", "") viper.SetDefault("CONTACT_REPLY_EMAIL", "noreply@company.com") viper.SetDefault("CONTACT_REPLY_BCC_EMAIL", "contact@company.com") - viper.SetDefault("EMAIL_SUBJECT", "Thanks to try our product") + viper.SetDefault("EMAIL_SUBJECT", "New message from contact form") viper.SetDefault("SMTP_AUTHENTICATION_ENABLED", true) host := os.Getenv("HOST") diff --git a/sendmail.go b/sendmail.go index cae0fd0..9b282b1 100644 --- a/sendmail.go +++ b/sendmail.go @@ -257,7 +257,7 @@ func SendMail(httpResp http.ResponseWriter, httpReq *http.Request) { sendMailReq := NewSendMailRequest( contactEmail, recipients, - contactRequest.Subject, + viper.GetString("EMAIL_SUBJECT"), ) err := sendMailReq.ParseTemplate(replyTplFile, templateData)