diff --git a/config/config.go b/config/config.go index 801f927..c39e8e3 100644 --- a/config/config.go +++ b/config/config.go @@ -111,10 +111,10 @@ type sentryConfig struct { } type mailConfig struct { - Enabled bool `env:"WAKAPI_MAIL_ENABLED" default:"true"` - Provider string `env:"WAKAPI_MAIL_PROVIDER" default:"smtp"` - MailWhale *MailwhaleMailConfig `yaml:"mailwhale"` - Smtp *SMTPMailConfig `yaml:"smtp"` + Enabled bool `env:"WAKAPI_MAIL_ENABLED" default:"true"` + Provider string `env:"WAKAPI_MAIL_PROVIDER" default:"smtp"` + MailWhale MailwhaleMailConfig `yaml:"mailwhale"` + Smtp SMTPMailConfig `yaml:"smtp"` } type MailwhaleMailConfig struct { diff --git a/services/mail/mailwhale.go b/services/mail/mailwhale.go index d7cc164..62710d0 100644 --- a/services/mail/mailwhale.go +++ b/services/mail/mailwhale.go @@ -13,7 +13,7 @@ import ( type MailWhaleMailService struct { publicUrl string - config *conf.MailwhaleMailConfig + config conf.MailwhaleMailConfig httpClient *http.Client } @@ -26,7 +26,7 @@ type MailWhaleSendRequest struct { TemplateVars map[string]string `json:"template_vars"` } -func NewMailWhaleService(config *conf.MailwhaleMailConfig, publicUrl string) *MailWhaleMailService { +func NewMailWhaleService(config conf.MailwhaleMailConfig, publicUrl string) *MailWhaleMailService { return &MailWhaleMailService{ publicUrl: publicUrl, config: config, diff --git a/services/mail/smtp.go b/services/mail/smtp.go index d040f51..3007bd5 100644 --- a/services/mail/smtp.go +++ b/services/mail/smtp.go @@ -13,11 +13,11 @@ import ( type SMTPMailService struct { publicUrl string - config *conf.SMTPMailConfig + config conf.SMTPMailConfig auth sasl.Client } -func NewSMTPMailService(config *conf.SMTPMailConfig, publicUrl string) *SMTPMailService { +func NewSMTPMailService(config conf.SMTPMailConfig, publicUrl string) *SMTPMailService { return &SMTPMailService{ publicUrl: publicUrl, config: config,