chore: extract mail to it's own service
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 45s
Some checks failed
Build Docker Image / Explore-Gitea-Actions (push) Failing after 45s
This commit is contained in:
34
utils/env.go
34
utils/env.go
@@ -7,44 +7,14 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
SmtpHost string
|
||||
SmtpPort string
|
||||
SmtpUser string
|
||||
SmtpPass string
|
||||
SmtpFromMail string
|
||||
SmtpFromName string
|
||||
BaseUrl string
|
||||
Environment string
|
||||
BaseUrl string
|
||||
Environment string
|
||||
)
|
||||
|
||||
func MustInitEnv() {
|
||||
SmtpHost = os.Getenv("SMTP_HOST")
|
||||
SmtpPort = os.Getenv("SMTP_PORT")
|
||||
SmtpUser = os.Getenv("SMTP_USER")
|
||||
SmtpPass = os.Getenv("SMTP_PASS")
|
||||
SmtpFromMail = os.Getenv("SMTP_FROM_MAIL")
|
||||
SmtpFromName = os.Getenv("SMTP_FROM_NAME")
|
||||
BaseUrl = os.Getenv("BASE_URL")
|
||||
Environment = os.Getenv("ENVIRONMENT")
|
||||
|
||||
if SmtpHost == "" {
|
||||
log.Fatal("SMTP_HOST must be set")
|
||||
}
|
||||
if SmtpPort == "" {
|
||||
log.Fatal("SMTP_PORT must be set")
|
||||
}
|
||||
if SmtpUser == "" {
|
||||
log.Fatal("SMTP_USER must be set")
|
||||
}
|
||||
if SmtpPass == "" {
|
||||
log.Fatal("SMTP_PASS must be set")
|
||||
}
|
||||
if SmtpFromMail == "" {
|
||||
log.Fatal("SMTP_FROM_MAIL must be set")
|
||||
}
|
||||
if SmtpFromName == "" {
|
||||
log.Fatal("SMTP_FROM_NAME must be set")
|
||||
}
|
||||
if BaseUrl == "" {
|
||||
log.Fatal("BASE_URL must be set")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user