Skip to content

feat: show the task/document title in notification emails - #4

Merged
pikann merged 1 commit into
Paca-AI:masterfrom
vhervatin:feat/notification-entity-title
Oct 7, 2026
Merged

pikann merged 1 commit into
Paca-AI:masterfrom
vhervatin:feat/notification-entity-title

Conversation

@vhervatin

Copy link
Copy Markdown

Why

The assignment and mention emails say only "A task was assigned to you" / "You were mentioned", with no indication of which task or document — the recipient has to click through to find out. The in-app notification already shows the task title; this brings the email up to parity.

What

Core now publishes an entity_title field on the notification events (Paca-AI/paca#553). This PR reads it and weaves it into both the subject and body:

Topic Subject (with title) Body
assigned Task assigned: Ship the landing page Ada assigned you the task "Ship the landing page".
comment mention You were mentioned in "Ship the landing page" Ada mentioned you in a comment on "Ship the landing page".
doc mention You were mentioned in "Q4 roadmap" Ada mentioned you in the document "Q4 roadmap".
task-description mention You were mentioned in "Ship the landing page" Ada mentioned you in the description of "Ship the landing page".

Graceful degradation: when entity_title is empty (an older core that predates the field, or a title that couldn't be resolved) the original title-less copy is used verbatim — so this is safe to ship against any core version.

The title flows through the existing escaping/encoding (escapeHTML in the body, Q-encoding in the subject), so no new injection surface.

Testing

  • go vet . and go test . pass (including new TestRenderNotificationEmail_IncludesEntityTitle and ..._FallsBackWithoutTitle).
  • tinygo build -target=wasip1 -buildmode=c-shared succeeds (uses only strings/fmt, no new reflect/template usage).
  • Depends on feat(notification): include task/doc title in email event payload paca#553 for the payload field (but works without it thanks to the empty-title fallback).

🤖 Generated with Claude Code

The assignment and mention emails previously said only "A task was
assigned to you" / "You were mentioned", with no indication of which
task or document — the recipient had to click through to find out.

Core now publishes an entity_title field on the notification events (see
Paca-AI/paca). Read it and weave it into both the subject and body, e.g.
"Task assigned: Ship the landing page" and "Ada assigned you the task
\"Ship the landing page\".". When entity_title is empty (an older core,
or a title that couldn't be resolved) the original title-less copy is
used verbatim, so this degrades gracefully against any core version.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@pikann pikann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Thank you for the contribution! 🚀

@pikann
pikann merged commit e81900a into Paca-AI:master Oct 7, 2026
3 checks passed
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.

2 participants