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

Email template issues #11756

Closed
5 tasks done
JohnONolan opened this issue Apr 20, 2020 · 5 comments
Closed
5 tasks done

Email template issues #11756

JohnONolan opened this issue Apr 20, 2020 · 5 comments
Assignees
Labels
bug [triage] something behaving unexpectedly

Comments

@JohnONolan
Copy link
Member

JohnONolan commented Apr 20, 2020

There are several issues with our email templates at the moment:


Mobile font size

Occasionally font size is significantly reduced on mobile devices. It does not appear to matter what size of device, but it does appear to be specific to Apple Mail, or native iOS apps which use the Apple Mail ... mail renderer(?) - screenshots below are of FrontApp, on an iPhone 11 Pro Max


Bookmark cards

There seem to be some spacing issues around bookmark cards, FrontApp, Macbook Pro


Video embeds

Currently video embeds don't degrade at all for email, they just break / don't show up. It would be good if, at least, they could degrade to a bookmark card.


TODO:

  • Fix mobile font size
  • Fix bookmark card spacing
  • Fix video embed degradation
    • Outlook specific fallback
    • Fix display in gmail mobile
@ErisDS ErisDS added the bug [triage] something behaving unexpectedly label Apr 20, 2020
@JohnONolan
Copy link
Member Author

JohnONolan commented Apr 23, 2020

I was just rooting around in Discourse and, by coincidence, found this right before the closing body tag of their email template:

<!-- prevent Gmail on iOS font size manipulation -->
<div style="display:none;white-space:nowrap;font:15px courier;line-height:0">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>

Have not researched so far, so I don't know if it's related or relevant.

Also https://css-tricks.com/override-gmail-mobile-optimized-email/

kevinansfield added a commit to TryGhost/Admin that referenced this issue Apr 29, 2020
refs TryGhost/Ghost#11756

- we'd like to render fallbacks for embed cards in constrained environments such as emails where the `html` contents may not be suitable
- oembed gives us data to be able to create fallbacks this such as a `thumbnail_url`, author information, and sizing but we were not storing it
- this change removes the `html` and `type` data from the response object as the existing top-level payload properties then stores the remainder of the response under a `metadata` property
@kevinansfield
Copy link
Contributor

kevinansfield commented Apr 29, 2020

As of next Ghost release video embeds will render a thumbnail with a play button overlay in emails, the whole thumbnail is a link to the original video url.

Note that this will only work for newly created embed cards, unfortunately we weren't storing thumbnail data alongside old embed cards.

kevinansfield added a commit to TryGhost/Koenig that referenced this issue Apr 30, 2020
refs TryGhost/Ghost#11756

- Outlook versions that use the Word rendering engine do not support background images
- added VML markup for video fallbacks and used conditional comments and `mso-hide: all` styles so that only the VML version is seen in Outlook while the table version is seen in all other clients
kevinansfield added a commit that referenced this issue Apr 30, 2020
refs #11756

- updates `@tryghost/kg-default-cards` which includes a VML version of video embed card fallbacks
- fixes play button styling for Yahoo Mail
- adds a minimum height to video embeds so they appear more reasonable when images are not loaded
kevinansfield added a commit that referenced this issue May 1, 2020
…le apps

refs #11756

- fixed gmail scaling problems
  - the `width: 600px` on `.container` was forcing gmail to always render at 600px wide and then use scaling to resize the email to fit the device width
  - for most emails gmail would also apply their own font resizing to compensate so it didn't look _too_ bad
  - some emails however would not trigger the font resizing, most notably when posts contained a feature image, which would result in very small text
  - removing the fixed `width: 600px` resolves the scaling problem and lets the email be truly responsive
- removed attribute selectors in the media query CSS
  - gmail does not support attribute selectors
  - attribute selectors used to be necessary for Yahoo Mail but this is no longer the case
- tested using litmus.com for all popular email clients
kevinansfield added a commit to TryGhost/Koenig that referenced this issue May 1, 2020
refs TryGhost/Ghost#11756

- gmail mobile web was stripping standalone `background-size: cover` so moved it to a shorthand `background` style
- gmail mobile web was stripping `visibility: hidden` and `opacity: 0` from the opaque spacer image so switched provider to get a transparent png (transparent gifs were not loaded by gmail)
- gmail mobile app was adjusting font-size and applying a height to the player button when the `&nbsp;` was present which broke the play button styling
kevinansfield added a commit that referenced this issue May 1, 2020
refs #11756

- bumped kg-default-cards package to generate fixed html for video embed fallbacks
kevinansfield added a commit that referenced this issue May 1, 2020
refs #11756

- we removed the fixed `width: 600px` to fix gmail scaling but that means we need a new way of creating a 600px centre column in Outlook
@kevinansfield
Copy link
Contributor

With the Gmail scaling / font-resizing fix I can't reproduce the bookmark spacing issues so I'm marking it as done and closing. We can revisit with more specific issues if/when we have further reports 🙂

@aamatte
Copy link

aamatte commented Jul 22, 2020

@kevinansfield
I am experiencing spacing issues with bookmarks on emails. It can be reproduced in the newsletter preview of a post.

Screen Shot 2020-07-22 at 17 31 03

In the image, "Ghost" is the author, and "Test Page" is the publisher.

I tried overriding the CSS classes kg-bookmark-author and kg-bookmark-publisher` with no luck.

@kevinansfield
Copy link
Contributor

@aamatte please open new issues rather than commenting on closed ones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

4 participants