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

Issue with - react-email/components >=v0.29. Preview Code adds misplaced line breaks causing buttons not render in Outlook 2016 & 2019 clients #1813

Open
Wigwamwam opened this issue Dec 10, 2024 · 2 comments

Comments

@Wigwamwam
Copy link

Wigwamwam commented Dec 10, 2024

Describe the Bug

Hey,
react-email button component causes rendering issues on outlook clients 2016 and 2019. This is only present on react-email/component v0.29 or above. The button and any subsequent components do not render.

Packages:

  • "@react-email/components": "0.0.29",
  • "@react-email/tailwind": "1.0.4",
  • "react-email": "3.0.4",

I believe this is due to the code preview incorrectly prettifies the code with miss placed linebreaks as I have compared the output code between 0.28 and 0.29 and the only difference is the linebreaks.

Which package is affected (leave empty if unsure)

@react-email/button, @react-email/components

Link to the code that reproduces this issue

private repo

To Reproduce

Below is an example of the rendering issue:
image

This is what it should look like (this is taken form your website so I expect outlook to produce a lower quality version):
image

Expected Behavior

When I use react-email/component v0.28 it appears correctly

What's your node version? (if relevant)

No response

@Wigwamwam Wigwamwam added the Type: Bug Confirmed bug label Dec 10, 2024
@Wigwamwam
Copy link
Author

Wigwamwam commented Dec 10, 2024

Following on from this I believe it is due to the code preview incorrectly prettifies the code with miss placed linebreaks

@Wigwamwam Wigwamwam changed the title react-email/components >=v0.29 - Buttons do not display in Outlook 2016 & 2019 clients react-email/components >=v0.29 - Preview Code adds misplaced linebreakd causing buttons to not display in Outlook 2016 & 2019 clients Dec 10, 2024
@Wigwamwam Wigwamwam changed the title react-email/components >=v0.29 - Preview Code adds misplaced linebreakd causing buttons to not display in Outlook 2016 & 2019 clients react-email/components >=v0.29 - Preview Code adds misplaced line breaks causing buttons not render in Outlook 2016 & 2019 clients Dec 10, 2024
@Wigwamwam Wigwamwam changed the title react-email/components >=v0.29 - Preview Code adds misplaced line breaks causing buttons not render in Outlook 2016 & 2019 clients Issue with - react-email/components >=v0.29. Preview Code adds misplaced line breaks causing buttons not render in Outlook 2016 & 2019 clients Dec 10, 2024
@project0
Copy link

I have a very similar problem with buttons, but it is not correlated with preview Code. Apparently something changed between react-render 1.0.2 and 1.0.3 .
I believe it broke the "if mso" syntax so outlook is no longer able to parse it (prettier change).

This is the diff (before, after):

<                     <td><a href="{{accept-invitation-url}}" style="line-height:normal;text-decoration:none;display:inline-block;max-width:100%;mso-padding-alt:0px;background-color:#02deaa;border:0px solid #333333;color:#ffffff;font-size:18px;font-weight:600;letter-spacing:0px;padding:16px 22px 16px 22px;text-align:center;text-transform:uppercase;box-shadow:0px 3px 0px #00C093;border-radius:35px;border-style:solid" target="_blank"><span><!--[if mso]><i style="mso-font-width:366.66666666666663%;mso-text-raise:24" hidden>&#8202;&#8202;&#8202;</i><![endif]--></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:12px">Accept Invitation</span><span><!--[if mso]><i style="mso-font-width:366.66666666666663%" hidden>&#8202;&#8202;&#8202;&#8203;</i><![endif]--></span></a></td>
---
>                     <td>
>                       <a
>                         href="{{accept-invitation-url}}"
>                         style="line-height:normal;text-decoration:none;display:inline-block;max-width:100%;mso-padding-alt:0px;background-color:#02deaa;border:0px solid #333333;color:#ffffff;font-size:18px;font-weight:600;letter-spacing:0px;padding:16px 22px 16px 22px;text-align:center;text-transform:uppercase;box-shadow:0px 3px 0px #00C093;border-radius:35px;border-style:solid"
>                         target="_blank"
>                         ><span
>                           ><!--[if mso
>                             ]><i
>                               style="mso-font-width:366.66666666666663%;mso-text-raise:24"
>                               hidden
>                               >&#8202;&#8202;&#8202;</i
>                             ><!
>                           [endif]--></span
>                         ><span
>                           style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:12px"
>                           >Accept Invitation</span
>                         ><span
>                           ><!--[if mso
>                             ]><i
>                               style="mso-font-width:366.66666666666663%"
>                               hidden
>                               >&#8202;&#8202;&#8202;&#8203;</i
>                             ><!
>                           [endif]--></span
>                         ></a
>                       >
>                     </td>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants