fix(postcard): an inlined result that fails the safety check sends the style block
- inlineHTML treats a failing post-inline check like an inliner error: the un-inlined HTML, which already passed validateHTML, is sent with its style block and the rate-limited inline:<layout> warning - mail is never stopped by the inliner, as the docs promise (WR-05) - README and docs/services/mail.md describe the check before inlining - TestMailSafetySmoke/inline_unsafe_output
This commit is contained in:
@@ -20,7 +20,7 @@ Each message gets an HTML part, rendered from the Markdown, and a plain-text par
|
||||
|
||||
Many mail clients drop a style block, so postcard also copies the CSS onto the elements it styles, as WinterCMS does: after the layout has rendered, every rule of the HTML's style elements is written into the `style` attribute of the elements it matches (with go-premailer), and CSS widths and heights also become `width` and `height` attributes. Classes stay on the elements. Rules that cannot be inlined, such as media queries and `:hover`, stay in a style element in the head; the style block holds only those afterwards. The preview, the test send and real mail are inlined the same way, and the plain-text part is never touched.
|
||||
|
||||
A layout keeps its CSS in the style block only when it opts out: a layout file with `disable_auto_inline_css = true` in its header (`1` and `yes` also work), or a layout edited in the admin with **Do not inline CSS** switched on (its CSS tab). The built-in layouts all inline. If the inliner fails on a message, that message is sent with its style block only and a warning is logged; mail is never stopped by it.
|
||||
A layout keeps its CSS in the style block only when it opts out: a layout file with `disable_auto_inline_css = true` in its header (`1` and `yes` also work), or a layout edited in the admin with **Do not inline CSS** switched on (its CSS tab). The built-in layouts all inline. The safety checks run on the message before inlining, whether or not the layout opts out. If the inliner fails on a message, or its result fails the safety checks, that message is sent with its style block only and a warning is logged; mail is never stopped by it.
|
||||
|
||||
## Partials
|
||||
|
||||
|
||||
Reference in New Issue
Block a user