1
0
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:
Ferdinand Mütsch 2021-04-12 22:57:52 +02:00
parent 0f1d1bce4d
commit 915436822b
3 changed files with 8 additions and 8 deletions

View File

@ -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 {

View File

@ -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,

View File

@ -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,