fix: Empty email body for grouped email

This commit is contained in:
Bastian Beier committed 2025-01-13 14:29:39 +01:00
1 parent 7940557ff6
commit ef2744a203
3 files changed
+9

No files matched your search

@@ -0,0 +1,3 @@
Bugfix: Prevent empty email body for grouped email notifications
https://github.com/owncloud/ocis/pull/10869
@@ -1,6 +1,7 @@
package command
import (
"fmt"
"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/events/stream"
"github.com/owncloud/ocis/v2/services/notifications/pkg/config"
@@ -51,6 +52,7 @@ func SendEmail(cfg *config.Config) *cli.Command {
return err
}
}
fmt.Println("successfully sent SendEmailsEvent")
return nil
},
}
@@ -131,6 +131,10 @@ func (s eventsNotifier) createGroupedMail(ctx context.Context, logger zerolog.Lo
})
}
}
if len(mts) == 0 && len(mtsVars) == 0 {
logger.Error().Msg("no body content for grouped email present")
return
}
rendered, err := email.RenderGroupedEmailTemplate(email.Grouped, map[string]string{
"DisplayName": userEvents.User.GetDisplayName(),