mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
fix: make mail provider configs non-nullable
This commit is contained in:
parent
0f1d1bce4d
commit
915436822b
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user