Merge pull request #4652 from wkloucek/notifications-config-fix

fix notifications config
This commit is contained in:
Willy Kloucek
2022-09-26 10:37:37 +02:00
committed by GitHub
3 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
Bugfix: Fix notifications service settings
We've fixed two notifications service setting:
- `NOTIFICATIONS_MACHINE_AUTH_API_KEY` was previously not picked up (only `OCIS_MACHINE_AUTH_API_KEY` was loaded)
- If you used a email sender address in the format of the default value of `NOTIFICATIONS_SMTP_SENDER` no email could be send.
https://github.com/owncloud/ocis/pull/4652

View File

@@ -118,7 +118,7 @@ func (m Mail) SendMessage(userIDs []string, msg, subject, senderDisplayName stri
email := mail.NewMSG()
if senderDisplayName != "" {
email.SetFrom(fmt.Sprintf("%s via owncloud <%s>", senderDisplayName, m.conf.Notifications.SMTP.Sender)).AddTo(to...)
email.SetFrom(fmt.Sprintf("%s via %s", senderDisplayName, m.conf.Notifications.SMTP.Sender)).AddTo(to...)
} else {
email.SetFrom(m.conf.Notifications.SMTP.Sender).AddTo(to...)
}

View File

@@ -55,7 +55,7 @@ func Server(cfg *config.Config) *cli.Command {
logger.Fatal().Err(err).Str("addr", cfg.Notifications.RevaGateway).Msg("could not get reva client")
}
svc := service.NewEventsNotifier(evts, channel, logger, gwclient, cfg.Commons.MachineAuthAPIKey, cfg.Notifications.EmailTemplatePath)
svc := service.NewEventsNotifier(evts, channel, logger, gwclient, cfg.Notifications.MachineAuthAPIKey, cfg.Notifications.EmailTemplatePath)
return svc.Run()
},
}