Skip to content

feat(notifications): include issue description in emails#1136

Merged
timothyfroehlich merged 5 commits intomainfrom
feat/email-issue-description
Mar 29, 2026
Merged

feat(notifications): include issue description in emails#1136
timothyfroehlich merged 5 commits intomainfrom
feat/email-issue-description

Conversation

@timothyfroehlich
Copy link
Copy Markdown
Owner

Summary

  • Adds the issue description as a sanitized <blockquote> in notification emails for new_issue and issue_assigned types
  • Converts ProseMirror doc to plain text via docToPlainText() before including in emails
  • Description is XSS-sanitized with sanitize-html before rendering

Test plan

  • Unit tests for description rendering in new_issue and issue_assigned emails
  • Unit test confirming no description blockquote when undefined
  • Unit test for XSS sanitization of description content
  • Unit test confirming description doesn't leak into other notification types
  • Existing notification formatting tests still pass (33 total)
  • pnpm run check passes (749 tests, types, lint, format)

🤖 Generated with Claude Code

…_assigned emails

Adds the issue description as a sanitized blockquote in notification
emails for new issues and issue assignments, giving recipients immediate
context without needing to click through.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 29, 2026 15:12
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pin-point Ready Ready Preview, Comment Mar 29, 2026 7:48pm

@supabase
Copy link
Copy Markdown

supabase bot commented Mar 29, 2026

Updates to Preview Branch (feat/email-issue-description) ↗︎

Deployments Status Updated
Database Sun, 29 Mar 2026 19:47:51 UTC
Services Sun, 29 Mar 2026 19:47:51 UTC
APIs Sun, 29 Mar 2026 19:47:51 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Sun, 29 Mar 2026 19:47:51 UTC
Migrations Sun, 29 Mar 2026 19:47:51 UTC
Seeding Sun, 29 Mar 2026 19:47:51 UTC
Edge Functions Sun, 29 Mar 2026 19:47:51 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds issue descriptions to notification emails (for new_issue and issue_assigned) by converting stored ProseMirror docs to plain text and rendering them in the email HTML with sanitization.

Changes:

  • Pass issueDescription (plain text via docToPlainText) into notification creation for createIssue and assignIssue.
  • Extend email formatting to optionally render the description in a <blockquote> for new_issue / issue_assigned.
  • Add unit tests covering description rendering, omission, and XSS sanitization behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/services/issues.ts Adds plain-text issueDescription to notification payloads for new issues and assignments.
src/lib/notifications.ts Threads issueDescription through createNotification into email rendering.
src/lib/notification-formatting.ts Renders the description blockquote in new_issue and issue_assigned emails with sanitization.
src/test/unit/notification-formatting.test.ts Adds unit tests for description inclusion/omission and sanitization in emails.
src/services/issues.test.ts Updates service test expectations to include issueDescription for createIssue.

Comment thread src/services/issues.ts Outdated
Comment thread src/services/issues.ts
Comment thread src/services/issues.ts Outdated
Comment thread src/lib/notification-formatting.ts Outdated
Comment thread src/lib/notification-formatting.ts Outdated
…Text call

- Move description blockquote outside <p> tag (block elements can't be
  nested inside <p>; invalid HTML causes inconsistent email client rendering)
- Compute docToPlainText once and reuse for both issueDescription and
  commentContent in the mentions path, avoiding redundant doc traversal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rendering

- Replace 8 positional params with EmailHtmlOptions interface
- Move sanitizedDescription computation to only run for new_issue/issue_assigned types
- Fix blockquote HTML indentation in template literal
- Add integration test verifying description flows through assignIssue()
- Update all call sites and test assertions to use options object

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/lib/notification-formatting.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@timothyfroehlich timothyfroehlich merged commit 9f9a2e4 into main Mar 29, 2026
27 checks passed
@timothyfroehlich timothyfroehlich deleted the feat/email-issue-description branch March 29, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review PR passed CI and has no unresolved review comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants