aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/config.go5
-rw-r--r--config/types.go8
2 files changed, 13 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
index 14c0bf2..ce2dd8b 100644
--- a/config/config.go
+++ b/config/config.go
@@ -14,6 +14,7 @@ var (
S3 S3Config
Server ServerConfig
Session SessionConfig
+ SMTP SMTPConfig
)
func init() {
@@ -44,4 +45,8 @@ func init() {
if err := Parse(&Session); err != nil {
log.Fatalf("failed to parse configuration: %v", err)
}
+
+ if err := Parse(&SMTP); err != nil {
+ log.Fatalf("failed to parse configuration: %v", err)
+ }
}
diff --git a/config/types.go b/config/types.go
index 34981c9..075b728 100644
--- a/config/types.go
+++ b/config/types.go
@@ -41,3 +41,11 @@ type S3Config struct {
UseSSL bool `env:"S3_USE_SSL" default:"false"`
PublicURL string `env:"S3_PUBLIC_URL" default:""`
}
+
+type SMTPConfig struct {
+ Host string `env:"SMTP_HOST" default:""`
+ Port int `env:"SMTP_PORT" default:"587"`
+ Username string `env:"SMTP_USERNAME" default:""`
+ Password string `env:"SMTP_PASSWORD" default:""`
+ From string `env:"EMAIL_FROM" default:""`
+}