update email configuration to use smtp server instead of resend
This commit is contained in:
parent
5c5ba78a32
commit
b340fd316f
1 changed files with 14 additions and 5 deletions
|
|
@ -22,8 +22,12 @@ type Config struct {
|
||||||
JWTSecret string
|
JWTSecret string
|
||||||
JWTExpiry time.Duration
|
JWTExpiry time.Duration
|
||||||
|
|
||||||
EmailFrom string
|
MailerSMTPHost string
|
||||||
ResendKey string
|
MailerSMTPPort string
|
||||||
|
MailerUsername string
|
||||||
|
MailerPassword string
|
||||||
|
MailerEmailFrom string
|
||||||
|
MailerEnvelopeFrom string
|
||||||
}
|
}
|
||||||
|
|
||||||
func Load() *Config {
|
func Load() *Config {
|
||||||
|
|
@ -46,8 +50,12 @@ func Load() *Config {
|
||||||
JWTSecret: envRequired("JWT_SECRET"),
|
JWTSecret: envRequired("JWT_SECRET"),
|
||||||
JWTExpiry: envDuration("JWT_EXPIRY", 168*time.Hour), // 7 days default
|
JWTExpiry: envDuration("JWT_EXPIRY", 168*time.Hour), // 7 days default
|
||||||
|
|
||||||
EmailFrom: envString("EMAIL_FROM", ""),
|
MailerSMTPHost: envString("MAILER_SMTP_HOST", ""),
|
||||||
ResendKey: envString("RESEND_KEY", ""),
|
MailerSMTPPort: envString("MAILER_SMTP_PORT", ""),
|
||||||
|
MailerUsername: envString("MAILER_USERNAME", ""),
|
||||||
|
MailerPassword: envString("MAILER_PASSWORD", ""),
|
||||||
|
MailerEmailFrom: envString("MAILER_EMAIL_FROM", ""),
|
||||||
|
MailerEnvelopeFrom: envString("MAILER_ENVELOPE_FROM", ""),
|
||||||
}
|
}
|
||||||
|
|
||||||
return cfg
|
return cfg
|
||||||
|
|
@ -68,7 +76,8 @@ func (c *Config) Sanitized() *Config {
|
||||||
Port: c.Port,
|
Port: c.Port,
|
||||||
AppTagline: c.AppTagline,
|
AppTagline: c.AppTagline,
|
||||||
|
|
||||||
EmailFrom: c.EmailFrom,
|
MailerEmailFrom: c.MailerEmailFrom,
|
||||||
|
MailerEnvelopeFrom: c.MailerEnvelopeFrom,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue