Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): Nv 5101 email sent from new dashbord has message clipped block in #7545

Conversation

BiswaViraj
Copy link
Member

What changed? Why was the change needed?

  • Remove the empty paragraphs from bottom of the email content to avoid "Message Clipped" indicator on Gmail.

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

linear bot commented Jan 20, 2025

Copy link

github-actions bot commented Jan 20, 2025

Hey there and thank you for opening this pull request! 👋

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Your PR title is: feat(api): Nv 5101 email sent from new dashbord has message clipped block in
It should be something like: feat(scope): Add fancy new feature

Details:

Unknown scope "api" found in pull request title "feat(api): Nv 5101 email sent from new dashbord has message clipped block in". Scope must match one of: root, api-service, dashboard, inbound-mail, web, webhook, widget, worker, ws, ee-auth, ee-billing, ee-dal, ee-shared-services, ee-translation, application-generic, automation, dal, design-system, embed, notifications, novui, testing, client, framework, headless, js, nest, nextjs, node, notification-center, novu, providers, react, react-native, shared, stateless, nestjs, nextjs.

Copy link

netlify bot commented Jan 20, 2025

Deploy Preview for dashboard-v2-novu-staging ready!

Name Link
🔨 Latest commit 46e1b28
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/678f4a8580481d0008f5f1d1
😎 Deploy Preview https://deploy-preview-7545.dashboard-v2.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 20, 2025

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 46e1b28
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/678f4a85fc4a1e0008c5e08f
😎 Deploy Preview https://deploy-preview-7545.dashboard.novu-staging.co
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

const childNode = node.content[i];

const isEmptyParagraph =
childNode.type === 'paragraph' && !childNode.text && (!childNode.content || childNode.content.length === 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

question: what about the other types like heading or text, don't they create an issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, they might cause the issue as well.
i will check and update accordingly Thanks 🙌🏼

Copy link
Member Author

Choose a reason for hiding this comment

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

The other content types don't cause this issue, as the text or content types properly handle it. However, when someone leaves an empty bullet/unordered/numbered list at the end, it leads to clipping.
I didn't handle that case as it will increase the complexity of this code and also an empty bullet list is easily identifiable on the email editor and will be very unlikely to miss it

Copy link
Contributor

@desiprisg desiprisg left a comment

Choose a reason for hiding this comment

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

Can we check if this issue is caused by the invisible node that's placed in the end by maily for UX purposes? Might not be the culprit though. If it is, it might help with the solution(since the node will always be there) and @LetItRock's comment.
https://github.com/arikchakma/maily.to/blob/main/packages/core/src/editor/extensions/tailing-node/tailing-node.ts

@BiswaViraj
Copy link
Member Author

BiswaViraj commented Jan 21, 2025

Can we check if this issue is caused by the invisible node that's placed in the end by maily for UX purposes?

I checked it only happens when the user manually leaves an empty paragraph at the end of the content. In other normal scenarios I was not able to reproduce the clipping
@desiprisg

@BiswaViraj BiswaViraj merged commit e5d1ee5 into next Jan 21, 2025
29 of 30 checks passed
@BiswaViraj BiswaViraj deleted the nv-5101-email-sent-from-new-dashbord-has-message-clipped-block-in branch January 21, 2025 09:37
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.

4 participants