[FW][FIX] web_editor: keep plain text email template padding in conversion #162596
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most e-mail clients apply some padding around their e-mails, like mass_mailing does in its editor. So for the plain text email template, we mostly don't want to transfer that padding, but for Apple Mail we do want some padding lest the e-mail be crammed in a corner. The editor's padding was lost in conversion because the padding was applied to a table with
border-collapse: collapse
so it was not applied (see mdn).Since we can't change that property (or layouts will be broken), our remaining option is to wrap the layout table's contents in a
div
and apply the padding to it instead. Since we only want this for Apple Mail, we apply it in a nested media query, which Apple Mail is currently the only client to support. This is the only known way to target Apple Mail specifically but since e-mail clients tend to be remarkably slow at adopting new technologies, this should be safe for a while.task-3062027
Co-authored-by: David Monjoie dmo@odoo.com
Forward-Port-Of: #105661