diff --git a/changelog/unreleased/enhancement-mail-notifications-grouping.md b/changelog/unreleased/enhancement-mail-notifications-grouping.md new file mode 100644 index 0000000000..85de9f3e23 --- /dev/null +++ b/changelog/unreleased/enhancement-mail-notifications-grouping.md @@ -0,0 +1,6 @@ +Enhancement: Part IV: Grouping of mail notifications + +Part IV: Mail notifications can now be grouped on a daily or weekly basis + +https://github.com/owncloud/ocis/pull/10838 +https://github.com/owncloud/ocis/issues/10793 diff --git a/services/notifications/README.md b/services/notifications/README.md index 4e70e81ad6..c3b912baf7 100644 --- a/services/notifications/README.md +++ b/services/notifications/README.md @@ -46,6 +46,29 @@ Custom email templates referenced via `NOTIFICATIONS_EMAIL_TEMPLATE_PATH` must a The `templates/html` subfolder contains a default HTML template provided by ocis. When using a custom HTML template, hosted images can either be linked with standard HTML code like ```logo-mail``` or embedded as a CID source ```logo-mail```. In the latter case, image files must be located in the `templates/html/img` subfolder. Supported embedded image types are png, jpeg, and gif. Consider that embedding images via a CID resource may not be fully supported in all email web clients. +## Grouped Emails + +The `notifications` service also supports grouped emails on a daily and weekly basis. The event IDs are stored using the `Store` interface. To send the grouped emails the CLI command `notifications send-email` has to be used. + +### Storing + +The `notifications` service persists information via the configured store in `NOTIFICATIONS_STORE`. Possible stores are: +- `memory`: Basic in-memory store. Will not survive a restart. This is not recommended for this service. +- `redis-sentinel`: Stores data in a configured Redis Sentinel cluster. +- `nats-js-kv`: Stores data using key-value-store feature of [nats jetstream](https://docs.nats.io/nats-concepts/jetstream/key-value-store). This is the default value. +- `noop`: Stores nothing. Useful for testing. Not recommended in production environments. + +Other store types may work but are not supported currently. + +Note: The service can only be scaled if not using `memory` store and the stores are configured identically over all instances! + +Note that if you have used one of the deprecated stores, you should reconfigure to one of the supported ones as the deprecated stores will be removed in a later version. + +Store specific notes: +- When using `redis-sentinel`, the Redis master to use is configured via e.g. `OCIS_CACHE_STORE_NODES` in the form of `:/` like `10.10.0.200:26379/mymaster`. +- When using `nats-js-kv` it is recommended to set `OCIS_CACHE_STORE_NODES` to the same value as `OCIS_EVENTS_ENDPOINT`. That way the cache uses the same nats instance as the event bus. +- When using the `nats-js-kv` store, it is possible to set `OCIS_CACHE_DISABLE_PERSISTENCE` to instruct nats to not persist cache data on disc. + ## Translations The `notifications` service has embedded translations sourced via transifex to provide a basic set of translated languages. These embedded translations are available for all deployment scenarios. diff --git a/services/notifications/pkg/config/config.go b/services/notifications/pkg/config/config.go index 9dd24773b2..08f41f260e 100644 --- a/services/notifications/pkg/config/config.go +++ b/services/notifications/pkg/config/config.go @@ -69,12 +69,6 @@ type ServiceAccount struct { ServiceAccountSecret string `yaml:"service_account_secret" env:"OCIS_SERVICE_ACCOUNT_SECRET;NOTIFICATIONS_SERVICE_ACCOUNT_SECRET" desc:"The service account secret." introductionVersion:"5.0"` } -// TODO: -// - README -// - DOCS -// - introductionVersion correct? -// - is TTL mandatory? - // Store configures the store to use type Store struct { Store string `yaml:"store" env:"OCIS_PERSISTENT_STORE;NOTIFICATIONS_STORE" desc:"The type of the store. Supported values are: 'memory', 'nats-js-kv', 'redis-sentinel', 'noop'. See the text description for details." introductionVersion:"7.1"`