mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-28 17:23:09 -06:00
Initialize mailer only if enabled
This commit is contained in:
parent
61b2c1e5c7
commit
6ccccaa373
|
|
@ -47,9 +47,12 @@ func NewInternalAPI(
|
|||
if err != nil {
|
||||
logrus.WithError(err).Panicf("failed to connect to threepid db")
|
||||
}
|
||||
mailer, err := mail.NewMailer(cfg)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Panicf("failed to crate Mailer")
|
||||
var mailer mail.Mailer
|
||||
if cfg.Email.Enabled {
|
||||
mailer, err = mail.NewMailer(cfg)
|
||||
if err != nil {
|
||||
logrus.WithError(err).Panicf("failed to crate Mailer")
|
||||
}
|
||||
}
|
||||
return &internal.UserInternalAPI{
|
||||
AccountDB: accountDB,
|
||||
|
|
|
|||
Loading…
Reference in a new issue