jdrouet / mrml

Implementation of mjml in rust
MIT License
361 stars 23 forks source link

Handle mj-html-attributes #426

Open nevans opened 6 months ago

nevans commented 6 months ago

https://documentation.mjml.io/#mj-html-attributes

Here's an example of how I'd like to use it:

<mjml>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
  <mj-head>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
    <mj-html-attributes>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
      <mj-selector path="a[href]">                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
        <mj-html-attribute name="clicktracking">off</mj-html-attribute>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
      </mj-selector>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
    </mj-html-attributes>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
  </mj-head>
...

In order to disable SendGrid's clicktracking for specific emails or specific links (e.g. forgot password).