Outlook email too wide, but only until I make a copy

Ghost Pro, Outlook 365 (2402) [And my client reports also Outlook 2007 - YES, they should upgrade]

I’m generating email newsletters programmatically - I’m using the API to feed in a post in HTML format. Everything looks great in Gmail. Everything looks great on my phone (iOS Safari). And the newsletter looks great online. However, the email doesn’t look great in Outlook. The post is much too wide. I can confirm that the problem exists in the latest version of Outlook. I’ve tried making a copy of the problem post, so that I can chop out parts of it and hopefully find the problem, but making a copy of the post produces a newsletter without the problem.

Does that ring a bell for anyone? How is the copy process (done by right clicking the post from the Ghost dashboard) different from using the API to create the post? It clearly is, but…

I guess in a pinch, I can create and then copy the post, but that feels silly.

When you’re feeding HTML in do you have width and height attributes on your images? My guess is that those are missing somewhere which is causing Outlook problems because it doesn’t handle resizing images itself well at all. When you make a copy and send the post gets opened in the editor which fills in the missing image size data before the post is published and newsletter sent.

Thank you, @Kevin ! I appreciate the pointer.

That’s interesting. No, I’m not including width/height info in some of the HTML I’m generating. My cloud function never actually retrieves the images from the source (and so is clueless about their size), but I guess it could and then I could run it through some image processing to get the size.

Is there a way to programmatically mimic opening the post in the editor? I’d rather not reinvent the wheel if I could let the Ghost editor do the work of analyzing these images for me! :)

Is there a way to programmatically mimic opening the post in the editor?

Not really, short of spinning up a headless browser instance and going through the auth etc to load the post in the editor. The way the automatic fill-in works is that the editor uses it’s browser environment to read dimensions from the DOM.

It would be great if Ghost filled in missing dimensions for you automatically when importing HTML though! Would you mind opening a bug report covering the issue you ran into?

1 Like