Skip to content

refactor: render booking additional notes as plain text#28897

Open
pedroccastro wants to merge 2 commits intomainfrom
refactor/booking-notes-rendering
Open

refactor: render booking additional notes as plain text#28897
pedroccastro wants to merge 2 commits intomainfrom
refactor/booking-notes-rendering

Conversation

@pedroccastro
Copy link
Copy Markdown
Contributor

What does this PR do?

Removes the formatted prop from the <Info> component used for additionalNotes in BaseScheduledEmail. The formatted prop converts the string to HTML via markdownToSafeHTML and renders it through dangerouslySetInnerHTML. For additionalNotes — which is user-entered free-form text — plain rendering is the safer and more predictable choice. The description field immediately above keeps formatted because event type descriptions are owner-controlled and already expected to be rendered markdown.

Changes

  • BaseScheduledEmail.tsx: remove formatted from the additionalNotes <Info> instance

Context

markdownToSafeHTML already uses sanitize-html to strip dangerous elements, so this is not closing an exploit — it removes an unnecessary HTML rendering path for a field that is never authored as markdown.

How should this be tested?

Manual

  1. Create a booking with additional notes containing plain text → rendered normally in confirmation email
  2. Booking with additional notes containing markdown syntax (**bold**) → rendered as literal characters (expected after change)

Mandatory Tasks

  • I have self-reviewed the code.
  • N/A I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67d68938-dd09-4714-9e81-00135bb889be

📥 Commits

Reviewing files that changed from the base of the PR and between a17f28e and d320ccf.

📒 Files selected for processing (1)
  • packages/emails/src/templates/BaseScheduledEmail.tsx

📝 Walkthrough

Walkthrough

The email template in BaseScheduledEmail.tsx was modified to remove the formatted prop from the Info component when rendering the additional_notes field. The component now passes only the withSpacer prop instead of withSpacer formatted. This change affects the styling or rendering behavior of the props.calEvent.additionalNotes value while maintaining the same label, spacer configuration, and conditional logic around the field.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing the formatted prop to render additional notes as plain text instead of HTML.
Description check ✅ Passed The description is clearly related to the changeset, explaining why the formatted prop was removed from additionalNotes and how to test the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/booking-notes-rendering

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 and usage tips.

@pedroccastro pedroccastro requested a review from a team April 15, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant