Skip to content

Commit 8dbd255

Browse files
committed
retrive sender name from env
1 parent 17bb077 commit 8dbd255

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

server/env/env.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ func InitAllEnv() error {
5757
osSmtpPassword := os.Getenv(constants.EnvKeySmtpPassword)
5858
osSmtpLocalName := os.Getenv(constants.EnvKeySmtpLocalName)
5959
osSenderEmail := os.Getenv(constants.EnvKeySenderEmail)
60+
osSenderName := os.Getenv(constants.EnvKeySenderName)
6061
osJwtType := os.Getenv(constants.EnvKeyJwtType)
6162
osJwtSecret := os.Getenv(constants.EnvKeyJwtSecret)
6263
osJwtPrivateKey := os.Getenv(constants.EnvKeyJwtPrivateKey)
@@ -257,6 +258,13 @@ func InitAllEnv() error {
257258
envData[constants.EnvKeySenderEmail] = osSenderEmail
258259
}
259260

261+
if val, ok := envData[constants.EnvKeySenderName]; !ok || val == "" {
262+
envData[constants.EnvKeySenderName] = osSenderName
263+
}
264+
if osSenderName != "" && envData[constants.EnvKeySenderName] != osSenderName {
265+
envData[constants.EnvKeySenderName] = osSenderName
266+
}
267+
260268
algoVal, ok := envData[constants.EnvKeyJwtType]
261269
algo := ""
262270
if !ok || algoVal == "" {

0 commit comments

Comments
 (0)