retrive sender name from env

This commit is contained in:
Michael Sahlu 2023-05-16 00:40:14 +03:00
parent 17bb077f3e
commit 8dbd2556eb

8
server/env/env.go vendored
View File

@ -57,6 +57,7 @@ func InitAllEnv() error {
osSmtpPassword := os.Getenv(constants.EnvKeySmtpPassword)
osSmtpLocalName := os.Getenv(constants.EnvKeySmtpLocalName)
osSenderEmail := os.Getenv(constants.EnvKeySenderEmail)
osSenderName := os.Getenv(constants.EnvKeySenderName)
osJwtType := os.Getenv(constants.EnvKeyJwtType)
osJwtSecret := os.Getenv(constants.EnvKeyJwtSecret)
osJwtPrivateKey := os.Getenv(constants.EnvKeyJwtPrivateKey)
@ -257,6 +258,13 @@ func InitAllEnv() error {
envData[constants.EnvKeySenderEmail] = osSenderEmail
}
if val, ok := envData[constants.EnvKeySenderName]; !ok || val == "" {
envData[constants.EnvKeySenderName] = osSenderName
}
if osSenderName != "" && envData[constants.EnvKeySenderName] != osSenderName {
envData[constants.EnvKeySenderName] = osSenderName
}
algoVal, ok := envData[constants.EnvKeyJwtType]
algo := ""
if !ok || algoVal == "" {