mjml
mjml copied to clipboard
If preview text exists don't display body text as preview
closes #1829
We ran into an issue were preview text from the body of the email was being displayed after the preview text. We found this article about how to prevent it and it's been working well for a couple months now.
This is based off this litmus article: https://www.litmus.com/blog/the-little-known-preview-text-hack-you-may-want-to-use-in-every-email/
Also thanks to @j56xie for her work finding this.
Example of the errors this fixes:
Will close #1829
Thanks for this PR @IanEdington ! Can you gate this behavior behind an attribute instead of modifying the default behavior ?
Cool thanks for the context. It seems like the kind of thing you would want on by default so new emails don't run into this weird behaviour. Would it make sense to include it as a breaking change in 4.9?
Are you thinking something like:
<Preview hideBody>
I know that some local clients doesn't handle those chars properly and display them as plain text that's mostly why I see this as an "opt-in" feature. Name looks good to me 👍
@iRyusa What do the clients that don't support the ZWNJ display instead of it?
Incidentally I've used this hack extensively but with the Combining Grapheme Joiner ͏
( Wikipedia ref, Unicode ref ) instead of the ZWNJ and haven't seen any issues, though I'm sure I'm missing some lesser-used clients out there. But perhaps worth testing as an alternative? This writeup (undated though) says the CGJ works on mail.ru where the ZWNJ doesn't.
They display directly the as a string in the preview text. It might be related to the text-version as mentioned in goodemailcode. But I think it behave like that on some french webmail too with no text-version sent.
On Wed, May 26, 2021 at 11:13 PM Ivan Boothe @.***> wrote:
@iRyusa https://github.com/iRyusa What do the clients that don't support the ZWNJ display instead of it?
Incidentally I've used this hack extensively but with the Combining Grapheme Joiner ͏ ( Wikipedia ref https://en.wikipedia.org/wiki/Combining_Grapheme_Joiner, Unicode ref https://www.compart.com/en/unicode/U+034F ) instead of the ZWNJ and haven't seen any issues, though I'm sure I'm missing some lesser-used clients out there. But perhaps worth testing as an alternative? This writeup https://www.goodemailcode.com/email-code/preheader (undated though) says the CGJ works on mail.ru where the ZWNJ doesn't.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mjmlio/mjml/pull/2263#issuecomment-849122742, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAELHTNAF7JFJLLBVQ7GXWTTPVQAZANCNFSM45K5NIHQ .
@IanEdington thank you for putting it up, we encountered the same issue as well. @iRyusa and is there a plan to merge this to master?
There are a few issues with this PR. It only gives a small gap between the content. The more characters the more of a gap it provides. Because screens are getting wider it's theoretically not possible to put enough characters to always hide the other content.
From my perspective this needs someone to run a subject line test on litmus or something similar to understand how many characters are needed to provide a good enough gap.
I'm not going to get to this in the next few months. @renjiezhu2 feel free to take over this PR
I can conform that ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏
works well across pretty much all email clients.
@IanEdington Screens are getting wide but people are doing more with the space and using all of the available 3440px to display Chrome (Gmail) or Outlook.
People that don't scale their 4K monitors deserve to see body content after the gap!
Hey all, I'm going to close this for now since I won't be working on it. I'd be happy for someone else to take over this work in another PR :D
Is there any solution now to having the