Fix 124: Send Gmail bodies as HTML (multipart/alternative)#176
Merged
Conversation
The Gmail compose path was passing the message body as bodyText only, so buildRawMessage emitted Content-Type: text/plain and recipients saw raw HTML tags when senders pasted formatted content. Now both an HTML and a plain-text alternative are built and shipped multipart/alternative. Plain-text input is escaped + newline-to-br so it still renders cleanly.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
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.
Summary
The Gmail compose path in
src/app/(app)/inbox/_send-actions.tswas passing the message body asbodyTextonly.buildRawMessagethen emittedContent-Type: text/plain, so when a sender pasted HTML (or any tag-containing content) into the compose textarea, recipients saw raw<p>,<br>,<div>tags in the inbox.This change builds both an HTML and a plain-text alternative and ships them as
multipart/alternative:\n→<br>, the plain alt is the original.HTML-capable clients render the formatted version; plain-text clients still see clean text.
PR #169 patched the
else if (opts.bodyHtml)branch ofbuildRawMessage, but that branch was unreachable from the only caller (which passedbodyText). #169 can be closed.Test plan
<b>Hello</b>) — recipient sees rendered Hello, not raw tags.> ...lines still render.