jdrouet / mrml

Implementation of mjml in rust
MIT License
322 stars 19 forks source link

Handle mj-html-attributes #426

Open nevans opened 1 month ago

nevans commented 1 month 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).