So, we got another step closer to displaying accurate renders of generated notices in a modal from the user notices pages with bug 39410.. However, whilst this properly dissociates the stylesheets used in the staff client from the notice preview modal using shadow DOM.. it does not yet mimic the escaping and reduced function set of HTML that email clients use to render mail. We should consider message transport type when rendering the display and for email type notices, we should parse them in the same way an email client would.
Email clients typically support: * Inline CSS only * Basic tags (<table>, <tr>, <td>, <p>, <img>, <a>, etc.) * No <style>, <script>, or modern CSS like flexbox, grid, etc. Perhaps I'm looking at this from the wrong level.. we should be considering this when generating email type notices and use an inliner or transposer to convert our modern HTML template driven notices to the restricted rules from above. We could even bundle something like https://bootstrapemail.com/.
This sounds pretty interesting. Some of the local feedback I got for bug 11583 was about generating previews but I didn't feel confident that we could do a really good preview. This could help a lot with that.
We could even add some advice near the editor to tell people to keep it simple as you've described, Martin. I notice sometimes that libraries want to do these really elaborate emails, but simpler is better imho...