fix(preview): drop U+FEFF from the whitespace filler so senders don't blank the email#3681
Open
AdamFarrar wants to merge 1 commit into
Open
fix(preview): drop U+FEFF from the whitespace filler so senders don't blank the email#3681AdamFarrar wants to merge 1 commit into
AdamFarrar wants to merge 1 commit into
Conversation
… blank the email The hidden preview-text padding in `<Preview>` includes U+FEFF (BOM / ZERO WIDTH NO-BREAK SPACE). A mid-document BOM is treated as a stream marker by some HTML/MIME parsers — notably SendGrid's — which truncate everything after it, so the body and CTA are dropped and the email renders completely blank in Gmail and Apple Mail. The other six zero-width characters still pad the preview snippet, so there is no visible change for clients that handle the filler correctly. Removes U+FEFF from `whiteSpaceCodes` and updates the affected snapshots. Refs resend#609, resend#1785, resend#1806
Contributor
|
@AdamFarrar is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 6a2736b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
<Preview>'s hidden preview-text padding includes(BOM / ZERO WIDTH NO-BREAK SPACE) inwhiteSpaceCodes:It's repeated
PREVIEW_MAX_LENGTH - text.lengthtimes, so a short preview emits a long run of these characters — including many BOMs — near the top of the<body>. A mid-document BOM is treated as a stream marker by some HTML/MIME parsers (notably SendGrid, which re-parses the HTML for tracking), and they truncate everything after it. The body and CTA get dropped and the email renders completely blank in Gmail / Apple Mail. Themultipart/alternativeplain-text part is unaffected, which is why the failure can look intermittent.This matches several existing reports:
<Preview>component's unicode characters break through some senders #609 —<Preview>'s unicode characters break through some senders<Preview>causes emails to appear completely empty in GmailThe fix
Drop
fromwhiteSpaceCodes. The other six characters (\xa0 ) are ordinary no-break / zero-width characters that still pad the preview snippet, so there's no visible change for clients that handle the filler correctly — the parser-breaking BOM is simply removed.Snapshots in
preview.spec.tsxandpackages/ui'sget-email-component.spec.tsare updated to match; both pass.Summary by cubic
Removed U+FEFF (BOM) from the
<Preview>component’s hidden whitespace filler to stop some senders (e.g., SendGrid) from truncating HTML and rendering emails blank. The remaining zero‑width characters still pad the preview; snapshots updated accordingly.Written for commit 6a2736b. Summary will update on new commits.