From 072cf11f8ead35a5c60b66167b704f8baaf4e6ec Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Sun, 15 Mar 2020 16:29:51 +0100 Subject: [PATCH] Fix: One env var was different from Maily-Form --- config.go | 2 +- config_test.go | 2 +- mail_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index 6608fa9..2ad726a 100644 --- a/config.go +++ b/config.go @@ -8,7 +8,7 @@ import ( type config struct { Port int `env:"PORT" envDefault:"8080"` HoneyPots []string `env:"HONEYPOTS" envDefault:"_t_email" envSeparator:","` - DefaultRecipient string `env:"DEFAULT_TO"` + DefaultRecipient string `env:"EMAIL_TO"` AllowedRecipients []string `env:"ALLOWED_TO" envSeparator:","` Sender string `env:"EMAIL_FROM"` SmtpUser string `env:"SMTP_USER"` diff --git a/config_test.go b/config_test.go index 142e160..8111460 100644 --- a/config_test.go +++ b/config_test.go @@ -28,7 +28,7 @@ func Test_parseConfig(t *testing.T) { os.Clearenv() _ = os.Setenv("PORT", "1111") _ = os.Setenv("HONEYPOTS", "pot,abc") - _ = os.Setenv("DEFAULT_TO", "mail@example.com") + _ = os.Setenv("EMAIL_TO", "mail@example.com") _ = os.Setenv("ALLOWED_TO", "mail@example.com,test@example.com") _ = os.Setenv("EMAIL_FROM", "forms@example.com") _ = os.Setenv("SMTP_USER", "test@example.com") diff --git a/mail_test.go b/mail_test.go index 0a920fd..c731a84 100644 --- a/mail_test.go +++ b/mail_test.go @@ -12,7 +12,7 @@ func Test_findRecipient(t *testing.T) { prepare := func() { os.Clearenv() _ = os.Setenv("ALLOWED_TO", "mail@example.com,test@example.com") - _ = os.Setenv("DEFAULT_TO", "mail@example.com") + _ = os.Setenv("EMAIL_TO", "mail@example.com") appConfig, _ = parseConfig() } t.Run("No recipient specified", func(t *testing.T) {