Skip to content

fix: unescape HTML entities in plain-text email bodies - #9522

Draft
okxint wants to merge 1 commit into
makeplane:developfrom
okxint:fix/email-html-unescape
Draft

fix: unescape HTML entities in plain-text email bodies#9522
okxint wants to merge 1 commit into
makeplane:developfrom
okxint:fix/email-html-unescape

Conversation

@okxint

@okxint okxint commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

django.utils.html.strip_tags() strips HTML markup but leaves character entities (&, <, etc.) in the output as literals. In invitation and authentication emails, URLs are rendered inside HTML anchor tags — so & in query strings becomes & in the HTML source. After stripping tags the entity survives, producing fallback links like:

https://app.plane.so/workspace-invitations/?invitation_id=…&slug=…

Email clients that display the plain-text part pass this literally to the browser, which sees amp;slug and amp;token instead of slug and token. The invitation page never fetches /api/workspaces/<slug>/invitations/<id>/ and stays on the loading screen indefinitely.

Wrapping the result in html.unescape() decodes all entities before the text is stored or sent. Applied consistently across every email background task that follows the same pattern.

Fixes #9497

`strip_tags()` removes HTML markup but leaves entities like `&amp;`
intact, so invitation URLs in the plain-text fallback render as
`&amp;slug=…&amp;token=…`. Browsers then receive `amp;slug` and
`amp;token` as query keys, breaking invitation and password-reset flows.

Wrapping the output with `html.unescape()` decodes all entities before
the text is stored or sent.

Fixes makeplane#9497
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ef2bf83a-1e95-4ed8-bca2-4becff43f28f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

1 participant