Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mail template configuration #330

Merged
merged 6 commits into from
Jul 20, 2023
Merged

mail template configuration #330

merged 6 commits into from
Jul 20, 2023

Conversation

wkloucek
Copy link
Contributor

@wkloucek wkloucek commented Jun 20, 2023

Description

adds the option to configure mail templates. On the way it adds an example deployment with mailbucket to test mail sending functionality.

Related Issue

Motivation and Context

allow to change mail templates

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation generated (make docs) and committed
  • Documentation ticket raised:
  • Documentation PR created:

@wkloucek
Copy link
Contributor Author

I ran into this:

kubectl -n ocis logs -f deployment/notifications
{"level":"error","service":"notifications","error":"read /etc/ocis/notifications/templates/html/img/..data: is a directory","event":"ShareCreated","time":"2023-06-20T15:09:57.6929667Z","line":"github.com/owncloud/ocis/v2/services/notifications/pkg/service/shares.go:59","message":"could not get render the email"}

Looks like the current implementation doesn't like Kubernetes ConfigMaps, because the template path looks like this when mounting these files as configmap:

kubectl exec -it -n ocis pods/notifications-76bbd45d77-znbf2 -- sh 
~ $ cd /etc/ocis/notifications/
/etc/ocis/notifications $ tree -a
.
└── templates
    ├── html
    │   ├── ..2023_06_20_15_09_09.176225182
    │   │   └── email.html.tmpl
    │   ├── ..data -> ..2023_06_20_15_09_09.176225182
    │   ├── email.html.tmpl -> ..data/email.html.tmpl
    │   └── img
    │       ├── ..2023_06_20_15_09_09.1371932421
    │       │   ├── logo-mail.gif
    │       │   ├── logo-mail.jpeg
    │       │   └── logo-mail.png
    │       ├── ..data -> ..2023_06_20_15_09_09.1371932421
    │       ├── logo-mail.gif -> ..data/logo-mail.gif
    │       ├── logo-mail.jpeg -> ..data/logo-mail.jpeg
    │       └── logo-mail.png -> ..data/logo-mail.png
    └── text
        ├── ..2023_06_20_15_09_09.4107791090
        │   └── email.text.tmpl
        ├── ..data -> ..2023_06_20_15_09_09.4107791090
        └── email.text.tmpl -> ..data/email.text.tmpl

10 directories, 10 files

@wkloucek wkloucek marked this pull request as ready for review July 19, 2023 15:15
@wkloucek wkloucek requested a review from d7oc July 19, 2023 15:15
Copy link
Contributor

@d7oc d7oc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we might need a new issue for the point I highlight in the comment.

# -- Reference to an existing SMTP email server settings secret (see ref:Secrets#secrets). Not used if `features.emailNotifications.enabled` equals `false`.
# -- Reference to an existing SMTP email server settings secret (see ref:Secrets#secrets).
# Not used if `features.emailNotifications.enabled` equals `false`.
# Not used if `features.emailNotifications.smtp.authentication` equals `none`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this description needs some more information about the keys we expect in the secret. Not especially related to this PR this was already missing before.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, the secret section https://doc.owncloud.com/ocis/next/deployment/container/orchestration/orchestration.html#secrets needs a complete rework since we switched to automatically creating secrets. Tracking issue: #367

@wkloucek wkloucek merged commit 62d3593 into master Jul 20, 2023
@delete-merged-branch delete-merged-branch bot deleted the mail-templates branch July 20, 2023 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expose configuration for email templates use NOTIFICATIONS_WEB_UI_URL
2 participants