From 9d29d8ce0fcf96c835013ebb73a32f2606d43c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 16 Jan 2025 17:01:27 +0100 Subject: [PATCH] notifications MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- services/notifications/README.md | 12 ++--- .../pkg/channels/channels_test.go | 10 ++--- services/notifications/pkg/config/config.go | 4 +- .../pkg/email/templates/html/email.html.tmpl | 4 +- .../pkg/email/templates/text/email.text.tmpl | 4 +- .../notifications/pkg/service/service_test.go | 44 +++++++++---------- 6 files changed, 39 insertions(+), 39 deletions(-) diff --git a/services/notifications/README.md b/services/notifications/README.md index eeb66d5eda..602a7a49dd 100644 --- a/services/notifications/README.md +++ b/services/notifications/README.md @@ -23,10 +23,10 @@ In addition, the notifications service supports custom templates. Custom email t {NOTIFICATIONS_EMAIL_TEMPLATE_PATH}/templates/html/email.html.tmpl {NOTIFICATIONS_EMAIL_TEMPLATE_PATH}/templates/html/img/ ``` -The source templates provided by ocis you can derive from are located in the following base folder [https://github.com/owncloud/ocis/tree/master/services/notifications/pkg/email/templates](https://github.com/owncloud/ocis/tree/master/services/notifications/pkg/email/templates) with subfolders `templates/text` and `templates/html`. +The source templates provided by OpenCloud you can derive from are located in the following base folder [https://github.com/opencloud-eu/opencloud/tree/master/services/notifications/pkg/email/templates](https://github.com/opencloud-eu/opencloud/tree/master/services/notifications/pkg/email/templates) with subfolders `templates/text` and `templates/html`. -- [text/email.text.tmpl](https://github.com/owncloud/ocis/blob/master/services/notifications/pkg/email/templates/text/email.text.tmpl) -- [html/email.html.tmpl](https://github.com/owncloud/ocis/blob/master/services/notifications/pkg/email/templates/html/email.html.tmpl) +- [text/email.text.tmpl](https://github.com/opencloud-eu/opencloud/blob/master/services/notifications/pkg/email/templates/text/email.text.tmpl) +- [html/email.html.tmpl](https://github.com/opencloud-eu/opencloud/blob/master/services/notifications/pkg/email/templates/html/email.html.tmpl) ### Templates subfolder hierarchy ```text @@ -43,7 +43,7 @@ templates ``` Custom email templates referenced via `NOTIFICATIONS_EMAIL_TEMPLATE_PATH` must also be located in subfolder `templates/text` and `templates/html` and must have the same names as the embedded templates. It is important that the names of these files and folders match the embedded ones. -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. +The `templates/html` subfolder contains a default HTML template provided by OpenCloud. 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. ## Sending Grouped Emails @@ -54,7 +54,7 @@ Grouped events are stored for the TTL defined in `OC_PERSISTENT_STORE_TTL`. This Grouped events that have passed the TTL are removed automatically without further notice or sending! -To initiate sending grouped emails like via a cron job, use the `ocis notifications send-email` command. Note that the command mandatory requires at least one option which is `--daily` or `--weekly`. Note that both options can be used together. +To initiate sending grouped emails like via a cron job, use the `opencloud notifications send-email` command. Note that the command mandatory requires at least one option which is `--daily` or `--weekly`. Note that both options can be used together. ### Storing @@ -92,7 +92,7 @@ For example, for the language `de`, one needs to place the corresponding transla -Important: For the time being, the embedded ownCloud Web frontend only supports the main language code but does not handle any territory. When strings are available in the language code `language_territory`, the web frontend does not see it as it only requests `language`. In consequence, any translations made must exist in the requested `language` to avoid a fallback to the default. +Important: For the time being, the embedded OpenCloud Web frontend only supports the main language code but does not handle any territory. When strings are available in the language code `language_territory`, the web frontend does not see it as it only requests `language`. In consequence, any translations made must exist in the requested `language` to avoid a fallback to the default. ### Translation Rules diff --git a/services/notifications/pkg/channels/channels_test.go b/services/notifications/pkg/channels/channels_test.go index 5140859d98..780454d456 100644 --- a/services/notifications/pkg/channels/channels_test.go +++ b/services/notifications/pkg/channels/channels_test.go @@ -11,7 +11,7 @@ func Test_appendSender(t *testing.T) { a mail.Address } - a1, err := mail.ParseAddress("ownCloud ") + a1, err := mail.ParseAddress("OpenCloud ") if err != nil { t.Error(err) } @@ -29,25 +29,25 @@ func Test_appendSender(t *testing.T) { { name: "empty sender", sender: "", - want1: `"ownCloud" `, + want1: `"OpenCloud" `, want2: ``, }, { name: "not empty sender", sender: `Joe Q. Public`, - want1: `"Joe Q. Public via ownCloud" `, + want1: `"Joe Q. Public via OpenCloud" `, want2: `"Joe Q. Public via" `, }, { name: "sender whit comma and semicolon", sender: `Joe, Q; Public:`, - want1: `"Joe, Q; Public: via ownCloud" `, + want1: `"Joe, Q; Public: via OpenCloud" `, want2: `"Joe, Q; Public: via" `, }, { name: "sender with quotes", sender: `Joe Q. "Public"`, - want1: `"Joe Q. \"Public\" via ownCloud" `, + want1: `"Joe Q. \"Public\" via OpenCloud" `, want2: `"Joe Q. \"Public\" via" `, }, } diff --git a/services/notifications/pkg/config/config.go b/services/notifications/pkg/config/config.go index 1ff7294ba2..4771a1c653 100644 --- a/services/notifications/pkg/config/config.go +++ b/services/notifications/pkg/config/config.go @@ -18,7 +18,7 @@ type Config struct { Log *Log `yaml:"log"` Debug Debug `yaml:"debug"` - WebUIURL string `yaml:"ocis_url" env:"OC_URL;NOTIFICATIONS_WEB_UI_URL" desc:"The public facing URL of the oCIS Web UI, used e.g. when sending notification eMails" introductionVersion:"pre5.0"` + WebUIURL string `yaml:"opencloud_url" env:"OC_URL;NOTIFICATIONS_WEB_UI_URL" desc:"The public facing URL of the OpenCloud Web UI, used e.g. when sending notification eMails" introductionVersion:"pre5.0"` Notifications Notifications `yaml:"notifications"` GRPCClientTLS shared.GRPCClientTLS `yaml:"grpc_client_tls"` @@ -44,7 +44,7 @@ type Notifications struct { type SMTP struct { Host string `yaml:"smtp_host" env:"NOTIFICATIONS_SMTP_HOST" desc:"SMTP host to connect to." introductionVersion:"pre5.0"` Port int `yaml:"smtp_port" env:"NOTIFICATIONS_SMTP_PORT" desc:"Port of the SMTP host to connect to." introductionVersion:"pre5.0"` - Sender string `yaml:"smtp_sender" env:"NOTIFICATIONS_SMTP_SENDER" desc:"Sender address of emails that will be sent (e.g. 'ownCloud '." introductionVersion:"pre5.0"` + Sender string `yaml:"smtp_sender" env:"NOTIFICATIONS_SMTP_SENDER" desc:"Sender address of emails that will be sent (e.g. 'OpenCloud '." introductionVersion:"pre5.0"` Username string `yaml:"smtp_username" env:"NOTIFICATIONS_SMTP_USERNAME" desc:"Username for the SMTP host to connect to." introductionVersion:"pre5.0"` Password string `yaml:"smtp_password" env:"NOTIFICATIONS_SMTP_PASSWORD" desc:"Password for the SMTP host to connect to." introductionVersion:"pre5.0"` Insecure bool `yaml:"insecure" env:"NOTIFICATIONS_SMTP_INSECURE" desc:"Allow insecure connections to the SMTP server." introductionVersion:"pre5.0"` diff --git a/services/notifications/pkg/email/templates/html/email.html.tmpl b/services/notifications/pkg/email/templates/html/email.html.tmpl index f36f076669..035feb1b0f 100644 --- a/services/notifications/pkg/email/templates/html/email.html.tmpl +++ b/services/notifications/pkg/email/templates/html/email.html.tmpl @@ -25,8 +25,8 @@

---
- ownCloud - Store. Share. Work.
- https://owncloud.com + OpenCloud - a safe home for all your data
+ https://opencloud.eu diff --git a/services/notifications/pkg/email/templates/text/email.text.tmpl b/services/notifications/pkg/email/templates/text/email.text.tmpl index b571692672..f6b7070a54 100644 --- a/services/notifications/pkg/email/templates/text/email.text.tmpl +++ b/services/notifications/pkg/email/templates/text/email.text.tmpl @@ -6,5 +6,5 @@ {{end}} --- -ownCloud - Store. Share. Work. -https://owncloud.com +OpenCloud - a safe home for all your data +https://opencloud.eu diff --git a/services/notifications/pkg/service/service_test.go b/services/notifications/pkg/service/service_test.go index ab79bb67af..7baf1db18d 100644 --- a/services/notifications/pkg/service/service_test.go +++ b/services/notifications/pkg/service/service_test.go @@ -37,14 +37,14 @@ var _ = Describe("Notifications", func() { Id: &user.UserId{ OpaqueId: "sharer", }, - Mail: "sharer@owncloud.com", + Mail: "sharer@opencloud.eu", DisplayName: "Dr. S. Harer", } sharee = &user.User{ Id: &user.UserId{ OpaqueId: "sharee", }, - Mail: "sharee@owncloud.com", + Mail: "sharee@opencloud.eu", DisplayName: "Eric Expireling", } resourceid = &provider.ResourceId{ @@ -118,8 +118,8 @@ Click here to view it: files/shares/with-me --- -ownCloud - Store. Share. Work. -https://owncloud.com +OpenCloud - a safe home for all your data +https://opencloud.eu `, expectedSender: sharer.GetDisplayName(), done: make(chan struct{}), @@ -143,8 +143,8 @@ Even though this share has been revoked you still might have access through othe --- -ownCloud - Store. Share. Work. -https://owncloud.com +OpenCloud - a safe home for all your data +https://opencloud.eu `, expectedSender: sharer.GetDisplayName(), done: make(chan struct{}), @@ -168,8 +168,8 @@ Click here to view it: f/spaceid --- -ownCloud - Store. Share. Work. -https://owncloud.com +OpenCloud - a safe home for all your data +https://opencloud.eu `, expectedSender: sharer.GetDisplayName(), done: make(chan struct{}), @@ -195,8 +195,8 @@ Click here to check it: f/spaceid --- -ownCloud - Store. Share. Work. -https://owncloud.com +OpenCloud - a safe home for all your data +https://opencloud.eu `, expectedSender: sharer.GetDisplayName(), done: make(chan struct{}), @@ -219,8 +219,8 @@ Even though this membership has expired you still might have access through othe --- -ownCloud - Store. Share. Work. -https://owncloud.com +OpenCloud - a safe home for all your data +https://opencloud.eu `, expectedSender: sharer.GetDisplayName(), done: make(chan struct{}), @@ -245,14 +245,14 @@ var _ = Describe("Notifications X-Site Scripting", func() { Id: &user.UserId{ OpaqueId: "sharer", }, - Mail: "sharer@owncloud.com", + Mail: "sharer@opencloud.eu", DisplayName: "Dr. O'reilly", } sharee = &user.User{ Id: &user.UserId{ OpaqueId: "sharee", }, - Mail: "sharee@owncloud.com", + Mail: "sharee@opencloud.eu", DisplayName: "", } resourceid = &provider.ResourceId{ @@ -331,8 +331,8 @@ Click here to view it: files/shares/with-me --- -ownCloud - Store. Share. Work. -https://owncloud.com +OpenCloud - a safe home for all your data +https://opencloud.eu `, expectedHTMLBody: ` @@ -361,8 +361,8 @@ https://owncloud.com

---
- ownCloud - Store. Share. Work.
- https://owncloud.com + OpenCloud - a safe home for all your data
+ https://opencloud.eu @@ -399,8 +399,8 @@ Click here to view it: f/spaceid --- -ownCloud - Store. Share. Work. -https://owncloud.com +OpenCloud - a safe home for all your data +https://opencloud.eu `, expectedSender: sharer.GetDisplayName(), expectedHTMLBody: ` @@ -430,8 +430,8 @@ https://owncloud.com

---
- ownCloud - Store. Share. Work.
- https://owncloud.com + OpenCloud - a safe home for all your data
+ https://opencloud.eu