ocis icon indicating copy to clipboard operation
ocis copied to clipboard

Notifications: PO file headers appear in translated emails when CallToAction is empty

Open snaggo opened this issue 4 days ago • 0 comments

Describe the bug

When a notification email template has no CallToAction defined (like ShareRemoved), the mail body contains the PO file headers. This happens in translated languaged like German (de) or Spanish (es), but not in English (en).

Steps to reproduce

  1. Run OCIS 7.3.1 with notifications enabled
  2. Set the default language to a translated locale, e.g. German or Spanish
  3. Share a file/folder with a user
  4. Remove that share
  5. The User receives a ShareRemoved email with PO file headers

Expected behavior

The translated message should only contain the subject, greeting and message body. No CallToAction should be shown, and no translation headers should appear like when using en locale.

Actual behavior

The email body contains raw gettext header:

Image Image

Additional context

Cause (probably):

In services/notifications/pkg/email/composer.go:

mt.CallToAction, err = composeMessage(t.Get(mt.CallToAction), vars)

When mt.CallToAction == "", this becomes t.Get("")

The email template already has {{ if .CallToAction }} so CallToAction is meant to be optional, but the code must not translate empty strings.

snaggo avatar Jan 14 '26 09:01 snaggo