Ghost/core/server/services/mega
Kevin Ansfield 84724537be 🐛 Fixed feature images in emails appearing very wide in Outlook
closes https://github.com/TryGhost/Team/issues/675

Outlook will display images at their native resolution if no `width` attribute is supplied. Content images were fixed a while ago but feature images would still render very wide and cause horizontal scroll and text size/alignment issues.

- modify `post.feature_image` and add a `post.feature_image_width` property before passing it through to the email template
  - for Unsplash images we assume all images are larger than 600px so we change the URL to reference a 1200px image and set the image width to 600 (to keep images on retina displays crisp)
  - for other images we probe the image to fetch the original dimensions and give set an image width of 600 if needed, if it's a locally-hosted image we update the URL to point at a max 1200px version
- updated email template to output a `width` attribute on the feature image `<img>` tag if it's set
2021-05-14 11:57:37 +01:00
..
index.js Extracted post email serializer from mega service 2019-11-05 12:15:50 +07:00
mega.js Added periodic "emails" limit check when (re)sending a newsletter 2021-05-07 18:45:14 +04:00
post-email-serializer.js 🐛 Fixed feature images in emails appearing very wide in Outlook 2021-05-14 11:57:37 +01:00
template.js 🐛 Fixed feature images in emails appearing very wide in Outlook 2021-05-14 11:57:37 +01:00