runbox7
runbox7 copied to clipboard
HTML emails have very poor formatting in the editor when replying to and forwarding them.
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.
@davidbowdley Does this typically affect commercial or bulk messages rather than simpler HTML content?
@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.
@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.
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...
- When viewing an HTML email, it takes a long time to display (lag caused by sanitation?), but eventually all images are displayed.
- The same email in Reply mode is not displaying all images, with "504 Gateway Timeout" errors presented in the console.
- 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?
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.
Should be covered/closed by #1003
This looks better now, but can we also support images in reply/forward mode?
Images are now shown in reply/forward.