Attached is a slightly modified (improved?) version of the commerce-order-receipt.html.twig .twig email template.

The attached template is nearly identical to the current default template except that it defines all the container widths using 100% so that tables expand to fill the available viewport width.

Users should also be informed that for best results they should modify the swiftmailer.html.twig file so that it also includes a width 100% directive, similar to the following:


/* ... */

<body>
<div>
  <table width="100%" cellpadding="0" cellspacing="0">
    <tr>
      <td>
        <div style="padding: 0px 0px 0px 0px;">
          {{ body }}
        </div>
      </td>
    </tr>
  </table>
</div>
</body>

/* ... */

Hopefully this modified commerce-order-receipt.html.twig file provide a better developer and site builder experience.

Comments

websiteworkspace created an issue.