From 8dbd2556eb3af2a80d830bc36a995588253fb6a3 Mon Sep 17 00:00:00 2001 From: Michael Sahlu Date: Tue, 16 May 2023 00:40:14 +0300 Subject: [PATCH] retrive sender name from env --- server/env/env.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/env/env.go b/server/env/env.go index 1528a4c..0340c32 100644 --- a/server/env/env.go +++ b/server/env/env.go @@ -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 == "" {