Skip to content

Notification emails escape HTML entities multiple times when sent to a group #2804

Closed

Description

@michaelstingl

Describe the bug

escapeStringMap (email.go#L206-L211) mutates its input map in place. eventsNotifier.render (service.go#L159-L176) passes the same fields map to RenderEmailTemplate on every loop iteration, so each iteration HTML-escapes values that were already escaped in the previous one.

Steps to reproduce

  1. Create a project space with & in the name, e.g. Test & Demo.
  2. Invite a group with ≥ 3 members as editor in a single call.
  3. Look at the resulting emails per recipient.

Expected behavior

All recipients get the same subject:

Inviter invited you to join Test & Demo

Actual behavior

Escape depth goes up by one per iteration. Observed on 6.1.0, group invite to 7 members:

Iteration Subject delivered
1 … Test & Demo
2 … Test & Demo
3 … Test & Demo
4 … Test & Demo
5 … Test & Demo
6 … Test & Demo
7 … Test & Demo

A separate single-recipient invite for the same space (fresh call, fresh map) produced 0× escape, so this is not per-user or locale.

All five handlers that call eventsNotifier.render are affected: ShareCreated, ShareExpired, SharedSpace, UnsharedSpace, MembershipExpired. Any character html.EscapeString touches (&, <, >, ", ') triggers it: apostrophes in display names, & in file or space names.

Setup

OpenCloud 6.1.0, notifications service default config.

🤖 drafted with Claude Code, reviewed before submitting.

Activity

  1. added a commit that references this issue on May 20, 2026
    12206e3
  2. moved this from Qualification to Done in OpenCloud Team Boardon May 21, 2026
  3. added a commit that references this issue on Oct 13, 2026
    e14fba7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions