Fix: One env var was different from Maily-Form
This commit is contained in:
parent
6f09bc8b10
commit
072cf11f8e
|
@ -8,7 +8,7 @@ import (
|
||||||
type config struct {
|
type config struct {
|
||||||
Port int `env:"PORT" envDefault:"8080"`
|
Port int `env:"PORT" envDefault:"8080"`
|
||||||
HoneyPots []string `env:"HONEYPOTS" envDefault:"_t_email" envSeparator:","`
|
HoneyPots []string `env:"HONEYPOTS" envDefault:"_t_email" envSeparator:","`
|
||||||
DefaultRecipient string `env:"DEFAULT_TO"`
|
DefaultRecipient string `env:"EMAIL_TO"`
|
||||||
AllowedRecipients []string `env:"ALLOWED_TO" envSeparator:","`
|
AllowedRecipients []string `env:"ALLOWED_TO" envSeparator:","`
|
||||||
Sender string `env:"EMAIL_FROM"`
|
Sender string `env:"EMAIL_FROM"`
|
||||||
SmtpUser string `env:"SMTP_USER"`
|
SmtpUser string `env:"SMTP_USER"`
|
||||||
|
|
|
@ -28,7 +28,7 @@ func Test_parseConfig(t *testing.T) {
|
||||||
os.Clearenv()
|
os.Clearenv()
|
||||||
_ = os.Setenv("PORT", "1111")
|
_ = os.Setenv("PORT", "1111")
|
||||||
_ = os.Setenv("HONEYPOTS", "pot,abc")
|
_ = 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("ALLOWED_TO", "mail@example.com,test@example.com")
|
||||||
_ = os.Setenv("EMAIL_FROM", "forms@example.com")
|
_ = os.Setenv("EMAIL_FROM", "forms@example.com")
|
||||||
_ = os.Setenv("SMTP_USER", "test@example.com")
|
_ = os.Setenv("SMTP_USER", "test@example.com")
|
||||||
|
|
|
@ -12,7 +12,7 @@ func Test_findRecipient(t *testing.T) {
|
||||||
prepare := func() {
|
prepare := func() {
|
||||||
os.Clearenv()
|
os.Clearenv()
|
||||||
_ = os.Setenv("ALLOWED_TO", "mail@example.com,test@example.com")
|
_ = 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()
|
appConfig, _ = parseConfig()
|
||||||
}
|
}
|
||||||
t.Run("No recipient specified", func(t *testing.T) {
|
t.Run("No recipient specified", func(t *testing.T) {
|
||||||
|
|
Reference in New Issue