Custom Email Template Not Saving HTML

Hello. I have produced a custom email template using basic HTML tags. However, when I paste my code into the template editor and view the preview window, it appears and looks perfect. After clicking save though, the system removes the entire template code. Going back to the template and opening it shows it is completely blank. To attempt a workaround, I replaced the template code directly in the mySQL database. The template then appeared on the site, but again, after clicking save it was moved. So I have no way to send my invoices out with my custom template. Can you please help? How can we make it where it does not strip any HTML code after saving a custom template? Thank you very much. My template code is below for reference with “XXXX” being placeholder text.

<table border="0" align="center" cellpadding="0" cellspacing="0" style="max-width:750px; width:75%;">
  <tr>
    <td align="left" valign="top"><div align="center"><img src="http://XXXXXX.com/logo@2x.png" width="300" height="77" alt="XXXX"/></div></td>
  </tr>
  <tr>
    <td align="left" valign="top" style="padding:20px;"><p align="center"><span style="color: #F05B23; font-weight: light; font-family: Arial, Helvetica, sans-serif; font-size: 24px;">W E L C O M E</span><br />
    </p>
      <p align="center"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 16px;">XXXXX</span></p>
      <p align="center"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 16px;">XXXXXX</span></p>
      <table width="100%" border="0" cellspacing="0" cellpadding="20" style="border:solid #666 1px">
        <tr>
          <td><p align="center" style="font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 16px;">{{{client_name}}}<br>
{{{client_web}}}<br><br>
Invoice #{{{invoice_number}}}<br>
Setup Amount + First Month's Service Fees:<br>{{{invoice_total}}}<br><br>
Payment Due Date:<br>{{{invoice_date_due}}}<br><br>
Recurring Monthly Service Fees:<br>{{{client_custom_combined_recurring_monthly_fee}}}</p></td>
        </tr>
      </table>
      <p><span style="font-family: Arial, Helvetica, sans-serif; font-size: 16px;">XXXXX.</span></p>
      <p><span style="font-family: Arial, Helvetica, sans-serif; font-size: 16px;">XXXXX<em>.</em></span></p>
      <p style="font-family: Arial, Helvetica, sans-serif; font-size: 16px;"><span style="color: #F05B23; font-family: Arial, Helvetica, sans-serif; font-size: 18px;">Your Next Steps:</span></p>
      <p style="font-family: Arial, Helvetica, sans-serif; font-size: 16px;"><span>1. XXXXX</span><a href="XXXXX"></a>.</p>
      <table border="0" align="center" cellpadding="10" cellspacing="0" width="25%" style="border:solid #F05B23 1px; height: 45px; min-width:175px">
        <tr>
          <td align="center"><span style="font-family: Arial, Helvetica, sans-serif;font-size: 16px; color:#F05B23; text-align:center;"><a href="XXXXX" style="font-family: Arial, Helvetica, sans-serif;font-size: 16px; color:#F05B23; text-align:center; text-decoration:none;">PAY ONLINE</a></span></td>
        </tr>
      </table>
      <p style="font-family: Arial, Helvetica, sans-serif; font-size: 16px;"><span>2. XXXXX.</span><br />
</p></td>
  </tr>
  <tr>
    <td align="right" valign="top" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px;"><hr size="1" />
      <div align="center"><br />
        XXXXX<a href="XXXXX"></a></div></td>
  </tr>
</table>

This is so ridiculous, I’m having the same problem without understanding why. I tried with different ways, different codes but it keep discard the body with HTML part whenever I saved the template. I had no default template after installing.

I’m experiencing the same problem. HTML is stripped when you hit save. Looks like xss_filtering is the reason. Changing [‘global_xss_filtering’] to FALSE in application/config/config.php fixes it but I know you don’t want to do that. Possible solutions Here Maybe implement disabling xss_filtering for that particular post?

1 Like