Skip to content

fix(workflow): line break not supported by Send Email Nodes#16561

Merged
etiennejouan merged 2 commits intotwentyhq:mainfrom
abk404:fix_email-line_break
Dec 15, 2025
Merged

fix(workflow): line break not supported by Send Email Nodes#16561
etiennejouan merged 2 commits intotwentyhq:mainfrom
abk404:fix_email-line_break

Conversation

@abk404
Copy link
Copy Markdown
Contributor

@abk404 abk404 commented Dec 15, 2025

Closes #16557

Tiptap Editor (which the Send Email Node uses) , creates a content json with type 'hardBreak' for line breaks.

The was no rederer defined for this hardBreak node type, so the renderNode function was ignoring that node (returning null).

Fix : Added a renderer for hardBreak node type.

Copilot AI review requested due to automatic review settings December 15, 2025 10:08
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

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

This PR fixes a bug where line breaks created in the Tiptap Editor were not being rendered in Send Email Nodes. The Tiptap Editor creates a 'hardBreak' node type for line breaks, but there was no renderer defined for this node type, causing it to be ignored.

  • Added support for rendering Tiptap's hardBreak node type as HTML <br /> elements
  • Registered the new HARD_BREAK node type constant in the shared Tiptap configuration
  • Created a new renderer function that converts hardBreak nodes to React <br /> elements

Reviewed changes

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

File Description
packages/twenty-shared/src/utils/tiptap/tiptap-marks.ts Added HARD_BREAK constant to the TIPTAP_NODE_TYPES enum for consistency between frontend and email renderer
packages/twenty-emails/src/utils/email-renderer/renderers/render-node.tsx Imported and registered the hardBreak renderer in the NODE_RENDERERS mapping
packages/twenty-emails/src/utils/email-renderer/nodes/hard-break.tsx Implemented the hardBreak renderer function that returns a <br /> element

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 3 files

@abk404
Copy link
Copy Markdown
Contributor Author

abk404 commented Dec 15, 2025

Added test as coverage dropped below threshold.

Copy link
Copy Markdown
Contributor

@etiennejouan etiennejouan left a comment

Choose a reason for hiding this comment

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

Hi @abk404 , Thank you for your contribution. It works fine 👏

@etiennejouan etiennejouan merged commit 042972d into twentyhq:main Dec 15, 2025
68 checks passed
@twenty-eng-sync
Copy link
Copy Markdown

Hey @etiennejouan! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

@github-actions
Copy link
Copy Markdown
Contributor

Thanks @abk404 for your contribution!
This marks your 5th PR on the repo. You're top 6% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

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.

[workflows] Line breaks not supported by Send Email nodes

4 participants