runbox7 icon indicating copy to clipboard operation
runbox7 copied to clipboard

HTML emails have very poor formatting in the editor when replying to and forwarding them.

Open runboxdave opened this issue 3 years ago • 7 comments

HTML emails have very poor formatting in the editor when replying and forwarding them. They are unusable for seeing what a message would look like to the recipient.

runboxdave avatar Oct 01 '20 08:10 runboxdave

@davidbowdley Does this typically affect commercial or bulk messages rather than simpler HTML content?

gtandersen avatar Oct 02 '20 01:10 gtandersen

@gtandersen I think the more complex the HTML the more it is affected. In one example which was a commercial email I could see no images and could even see table outlines that were not visible in the original message.

The reason for the discrepancy seems to be that the viewer for HTML message is not the same as the message composer and there is a disparity between their ability to render the HTML as intended.

runboxdave avatar Oct 02 '20 10:10 runboxdave

@davidbowdley Since it depends on the complexity of the message I suggest we adjust the title of the issue accordingly to e.g. "Some HTML emails have very poor formatting in the editor when replying to and forwarding them" and ideally attach an example.

I also suggest that we create a separate issue for images not being shown in some HTML messages as it sounds like a different problem.

gtandersen avatar Oct 02 '20 22:10 gtandersen

Was a separate issue created for images in the Reply view? I'll post the details here.

It seems that TinyMCE is trying to load images differently than the user agent normally would.

One example...

  1. When viewing an HTML email, it takes a long time to display (lag caused by sanitation?), but eventually all images are displayed.
  2. The same email in Reply mode is not displaying all images, with "504 Gateway Timeout" errors presented in the console.
  3. The affected images are all publicly accessible and can be loaded in a normal browser window.

So the only difference is TinyMCE doing the image loading, which is failing. Not sure why this results in a server-side error, though. Maybe the request sent for the images is different when TinyMCE initiates it, and the server is rejecting this?

ConnectGrid avatar Oct 30 '20 05:10 ConnectGrid

It seems we have 2 sanitised versions of HTML messages, the displayed one in the reader is generally directly pulled from the API. The content used for forwarding or replying has been differently sanitised (all style tags removed), by the frontend.

I suggest that if there is a copy available from the API, that we use that everywhere, and only sanitise locally if we can't get it somehow.

castaway avatar Feb 03 '21 12:02 castaway

Should be covered/closed by #1003

castaway avatar Jun 01 '21 12:06 castaway

This looks better now, but can we also support images in reply/forward mode?

gtandersen avatar Jan 23 '22 17:01 gtandersen

Images are now shown in reply/forward.

gtandersen avatar Dec 23 '22 10:12 gtandersen