jlelse
/
MailyGo
Archived
1
Fork 0

Fix: One env var was different from Maily-Form

This commit is contained in:
Jan-Lukas Else 2020-03-15 16:29:51 +01:00
parent 6f09bc8b10
commit 072cf11f8e
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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