File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 1111 DATABASE_NAME = ""
1212 SMTP_HOST = ""
1313 SMTP_PORT = ""
14+ SMTP_USERNAME = ""
15+ SMTP_PASSWORD = ""
1416 SENDER_EMAIL = ""
15- SENDER_PASSWORD = ""
1617 JWT_TYPE = ""
1718 JWT_SECRET = ""
1819 ALLOWED_ORIGINS = []string {}
Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ type Sender struct {
2727}
2828
2929func NewSender () Sender {
30- return Sender {User : constants .SENDER_EMAIL , Password : constants .SENDER_PASSWORD }
30+ return Sender {User : constants .SMTP_USERNAME , Password : constants .SMTP_PASSWORD }
3131}
3232
3333func (sender Sender ) SendMail (Dest []string , Subject , bodyMessage string ) error {
34- msg := "From: " + sender . User + "\n " +
34+ msg := "From: " + constants . SENDER_EMAIL + "\n " +
3535 "To: " + strings .Join (Dest , "," ) + "\n " +
3636 "Subject: " + Subject + "\n " + bodyMessage
3737
Original file line number Diff line number Diff line change @@ -94,12 +94,16 @@ func InitEnv() {
9494 constants .SMTP_PORT = os .Getenv ("SMTP_PORT" )
9595 }
9696
97- if constants .SENDER_EMAIL == "" {
98- constants .SENDER_EMAIL = os .Getenv ("SENDER_EMAIL" )
97+ if constants .SMTP_USERNAME == "" {
98+ constants .SMTP_USERNAME = os .Getenv ("SMTP_USERNAME" )
99+ }
100+
101+ if constants .SMTP_PASSWORD == "" {
102+ constants .SMTP_PASSWORD = os .Getenv ("SMTP_PASSWORD" )
99103 }
100104
101- if constants .SENDER_PASSWORD == "" {
102- constants .SENDER_PASSWORD = os .Getenv ("SENDER_PASSWORD " )
105+ if constants .SENDER_EMAIL == "" {
106+ constants .SENDER_EMAIL = os .Getenv ("SENDER_EMAIL " )
103107 }
104108
105109 if constants .JWT_SECRET == "" {
@@ -174,7 +178,7 @@ func InitEnv() {
174178 constants .DISABLE_MAGIC_LINK_LOGIN = os .Getenv ("DISABLE_MAGIC_LINK_LOGIN" ) == "true"
175179 constants .DISABLE_LOGIN_PAGE = os .Getenv ("DISABLE_LOGIN_PAGE" ) == "true"
176180
177- if constants .SMTP_HOST == "" || constants .SENDER_EMAIL == "" || constants .SENDER_PASSWORD == "" {
181+ if constants .SMTP_HOST == "" || constants .SMTP_USERNAME == "" || constants .SMTP_PASSWORD == "" || constants . SENDER_EMAIL == "" {
178182 constants .DISABLE_EMAIL_VERIFICATION = true
179183 constants .DISABLE_MAGIC_LINK_LOGIN = true
180184 }
You can’t perform that action at this time.
0 commit comments