Tengo una plantilla de correo electrónico en Magento 2: email-template.html
{{template config_path="design/email/header_template"}}
{{trans "%body" body=$data.body}}
{{template config_path="design/email/footer_template"}} 
Pero en variable $data.bodyes código html no texto:
$data.body = `
<table width="100%"> 
  <tr> 
     <td>Name: </td> <td>Join Xanka </td>
  </tr> 
  <tr> <td>Email: </td> <td>[email protected]</td> </tr>
  {{depend Test Send}} 
  <tr> <td>Subject: </td> <td>Test Send</td> </tr>
  {{/depend}} 
  <tr> <td>Message: </td> <td>we try send email use to test.</td> </tr>
</table>
Entonces, cómo representar el código html cuando se envía, envía un correo electrónico. ¡Muchas gracias!
Este es el resultado cuando el código de excusa print_r($this->_message->getBody());en la sendMessage()función:
                    
                        magento2
                                email
                                email-templates
                                
                    
                    
                        xanka
fuente
                
                
            fuente


Junto con
{{trans "%body" body=$data.body}}a{{trans "%body" body=$data.body|raw}}.Recuerde cambiar
type="text"atype="html"inemail_templates.xml, de lo contrario obtendrá HTML simple en sus correos.fuente