kartolo / direct_mail

it's an newsletter sending extension for the TYPO3 CMS
40 stars 115 forks source link

direct_mail conflicts with mjml / HTML Comments #175

Open Schweriner opened 4 years ago

Schweriner commented 4 years ago

Im using the mjml framework for a Newsletter which contains alot of HTML comments. Some important comments of the framework are getting removed when sending the Newsletters. There should be a setting to prevent direct_mail from removing HTML Comments

jokumer commented 4 years ago

I do not know mjml framework yet, but can you explain, why comments in HTML for end-users should be keept?

Schweriner commented 4 years ago

The framework uses comments to display / hide certain parts of the email templates. Something like:

<!--[if !mso]><!-->
<style type="text/css">
@media only screen and (max-width:480px) {
    @-ms-viewport { width:320px; }
    @viewport { width:320px; }
}
</style>
<!--<![endif]-->
<!--[if mso]>
<xml>
<o:OfficeDocumentSettings>
  <o:AllowPNG/>
  <o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<!--[if lte mso 11]>
<style type="text/css">
  .outlook-group-fix { width:100% !important; }
</style>
<![endif]-->
jokumer commented 4 years ago

Good point. Accepted from my side.

SSFGizmo commented 1 year ago

reminder

// Remove useless HTML comments
if (substr($this->dmailer['boundaryParts_html'][$bKey][0], 1) == 'END') {
    $this->dmailer['boundaryParts_html'][$bKey][1] = $this->removeHTMLComments($this->dmailer['boundaryParts_html'][$bKey][1]);
}