Code being added to HTML email templates after saving

Marcel H_
Tera Guru

I keep having an odd issue with HTML email templates that I've been working with, and wondering if anyone has ever seen anything like this.

I had my templates working well, except for some minor HTML formatting that I was tweaking, then all of a sudden the templates were loosing formatting, tables not formatted properly, etc. After looking at the code for the templates I noticed things like the following lines were being added to the code in seemingly random locations:

<span id="CmCaReT"></span>

<span id="__caret">_</span><!--

\u0

  (not inside any tags)

<p></p> (seemingly random, adding white space where there was none before, and not in an area in the editor or code that I changed)

<p>  </p> (added between lines where no spaces existed previously)

The other issue is that I'll go in and delete these added tags, save the template and check the code again and they'll be back. Sometimes it takes deleting the tags 5, 6, 7 times before the code will properly reflect what I want it to be.

It's truly maddening when you get everything looking the way you want in the email preview on the notification record, then test by generating records to trigger sending the mail, and have it come through completely messed up in the mail client.

12 REPLIES 12

tipp09
Kilo Explorer

We are seeing the same <span id="CmCaReT"></span> when pasting code inside knowledge articles.



It looks okay until you click save, then it inserts the span tag.



I'm investigating and will share the solution if I find one, but would love it if someone here cracked this for us.



Thanks!



Bryan


Never found a solution to this myself. Just had to check the template over and over to confirm the tags weren't in there before praying and saving it one more time.


Tiago Castanhe2
Kilo Contributor

Any fixes for this? I guess that using email scripting to "print" the code onto the notification would solve the problem, but it sounds like a poor solution to a problem that shouldn't exist.


joelmexia
Kilo Explorer

I was adding my own CSS do one of the KB Articles and came across the the same problem



At first it seemed that my code was in conflict with the original CSS file, there for it was being commented and added to a Class.



I over came this problem by commenting everything inside the <Style> clause and adding my own CLASS name and then calling it where needed in HTML code (example at the end)



The only other time the '<span id="CmCaReT"></span>' code was added was when on the EDIT mode and directly clicked the SOURCE CODE button.


*If you click it multiple times the '<span id="CmCaReT"></span>' code will be added the number of times you clicked



To solve this 1st click on any TEXT field on your article and only then click the SOURCE CODE button.



*It must be a Failsafe embedded in the Javascript that evaluates the Source code prior to making it available?



Let us know if it worked for you guys too  




** CODE USED



<style>


      <!--


      .hanSolo {


              list-style: none


      }



              .hanSolo > ul {


                      list-style: none;


                      margin: 0px 50px;


                      padding: 0;


                      font: normal 16px/22px Arial;


                      color: #999;


              }



              .hanSolo > li {


                      overflow: hidden;


                      position: relative;


                      padding: 0 0 10px 35px;


              }



                      .hanSolo > li::before {


                              content: '';


                              position: absolute;


                              left: 9px;


                              top: 9px;


                              width: 20px;


                              height: 999px;


                              border: 2px solid lightblue;


                              border-width: 2px 0 0 2px;


                      }



                      .hanSolo > li:last-child::before {


                              border-width: 2px 0 0;


                      }



                      .hanSolo > li::after {


                              content: '';


                              position: absolute;


                              left: 0;


                              top: 0;


                              width: 16px;


                              height: 16px;


                              background: #fff;


                              border: 2px solid lightblue;


                              border-radius: 50%;


                      }



                      .hanSolo > li.current,


                      .hanSolo > li.passed {


                              color: #000;


                      }



                              .hanSolo > li.current::before {


                                      border-top-color: dodgerblue;


                              }



                              .hanSolo > li.current::after {


                                      border-color: dodgerblue;


                                      background: dodgerblue;


                              }



                              .hanSolo > li.passed::before,


                              .hanSolo > li.passed::after {


                                      border-color: dodgerblue;


                              }


      -->


</style>


<div style="background-color: #ffffff; -webkit-border-radius: 1px 1px 0px 0px; border-radius: 5px 5px 0px 0px; border-top: 1px solid #cccccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0px solid #cccccc;">  </div>


<table style="background-color: #ffffff; border-top: 0px solid #cccccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0px solid #cccccc;" width="100%" cellspacing="0" cellpadding="0">


      <tbody>


              <tr>


                      <td>


                              <p style="padding: 0 20px; ;margin: 0; color: #0089c4; font-family: 'centrale_sans_book',CentraleSans,'tahoma','arial','helvetica','sans-serif'; font-size: 50px; line-height: 60px; font-weight: bold;">Autocar Empresa</p>


                      </td>


              </tr>


      </tbody>


</table>


<div class="cntgn-spacer" style="height: 8px; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc;">  </div>


<table style="background-color: #ffffff; border-top: 0px solid #cccccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0px solid #cccccc;" width="100%" cellspacing="0" cellpadding="0">


      <tbody>


              <tr>


                      <td valign="top" width="50%">


                              <p style="padding: 0 20px; color: #3c3c3c; font-family: 'centrale_sans_book',CentraleSans,'tahoma','arial','helvetica','sans-serif'; font-size: 15px; line-height: 19px;">Para facilitar el acceso a las oficinas de Philips en Sanchinarro Madrid, existe una ruta de autocar que realiza la ruta con el siguiente recorrido:  </p>


                              <p style="padding: 0 20px; color: #3c3c3c; font-family: 'centrale_sans_book',CentraleSans,'tahoma','arial','helvetica','sans-serif'; font-size: 15px; line-height: 19px;">  </p>


                      </td>


              </tr>


      </tbody>


</table>


<table style="background-color: #ffffff; border-top: 0px solid #cccccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0px solid #cccccc;" width="100%" cellspacing="0" cellpadding="0">


      <tbody>


              <tr>


                      <td valign="top" width="50%">


                              <p style="padding: 0 80px; color: #0089c4; font-family: 'centrale_sans_book',CentraleSans,'tahoma','arial','helvetica','sans-serif'; font-size: 15px;"><font size="5" color="#000000"><strong>RUTA PLAZA EL&Iacute;PTICA</strong></font></p>


                              <ul class="hanSolo">


                                      <li class="passed"><strong>07:00</strong> - PLAZA EL&Iacute;PTICA (Colegio San Viator)</li>


                                      <li class="passed"><strong>07:04</strong> - Glorieta Santa Mar&iacute;a de la Cabeza/Ferrocarril</li>


                                      <li class="passed"><strong>07:09</strong> - P&ordm; de las Delicias / Tortosa (Atocha)</li>


                                      <li class="passed"><strong>07:14</strong> - Cibeles / Alcal&aacute; (Ayuntamiento)</li>


                                      <li class="passed"><strong>07:18</strong> - Col&oacute;n / Goya (Hard Rock Caf&eacute;)</li>


                                      <li class="passed"><strong>07:25</strong> - Avda. AM&Eacute;RICA (Salida Metro Pr&iacute;ncipe Vergara esq. Fco. Silvela)</li>


                                      <li class="passed"><strong>07:31</strong> - P&ordm; Castellana, 68 /M&ordf; de Molina (Gregorio Mara&ntilde;&oacute;n, Metro)</li>


                                      <li class="passed"><strong>07:35</strong> - P&ordm; Castellana, 110 /Nuevos Ministerios, Metro</li>


                                      <li class="passed"><strong>07:38</strong> - Plaza Cuzco / Alcocer &ndash; pasado</li>


                                      <li class="passed"><strong>07:40</strong> - Castellana / Plaza de Castilla (Dep&oacute;sito del agua)</li>


                                      <li class="passed"><strong>07:45</strong> - Estaci&oacute;n de Chamart&iacute;n ( Enfrente Tienda de deportes)</li>


                                      <li class="passed"><u><strong><font size="4">07:55 - EDIFICIO PHILIPS</font></strong></u></li>


                              </ul>


                      </td>


              </tr>


              <tr>


                      <td valign="top" width="50%">


                              <p style="padding: 0 30px; color: #3c3c3c; font-family: 'centrale_sans_book',CentraleSans,'tahoma','arial','helvetica','sans-serif'; font-size: 15px;">  </p>


                              <ul class="hanSolo">


                                      <li class="passed"><font size="4"><u><strong>17:25</strong>  -  <strong>EDIFICIO PHILIPS</strong></u></font></li>


                                      <li class="passed">Estaci&oacute;n de Chamart&iacute;n</li>


                                      <li class="passed">Plaza de Castilla (Metro)</li>


                                      <li class="passed">Plaza Cuzco</li>


                                      <li class="passed">Nuevos Ministerios</li>


                                      <li class="passed">Avda. AM&Eacute;RICA</li>


                                      <li class="passed">Gregorio Mara&ntilde;&oacute;n, Metro</li>


                                      <li class="passed">Col&oacute;n / Goya</li>


                                      <li class="passed">Cibeles / Alcal&aacute;</li>


                                      <li class="passed">Atocha / Santa Mar&iacute;a de la Cabeza Inicio</li>


                                      <li class="passed">PLAZA EL&Iacute;PTICA</li>


                              </ul>


                      </td>


              </tr>


              <tr>


                      <td>


                              <p style="padding: 0 20px; color: #3c3c3c; font-family: 'centrale_sans_book',CentraleSans,'tahoma','arial','helvetica','sans-serif'; font-size: 15px; line-height: 19px;">  </p>


                              <p style="padding: 0 20px; color: #3c3c3c; font-family: 'centrale_sans_book',CentraleSans,'tahoma','arial','helvetica','sans-serif'; font-size: 15px; line-height: 19px;">  </p>


                              <p style="padding: 0 20px; color: #3c3c3c; font-family: 'centrale_sans_book',CentraleSans,'tahoma','arial','helvetica','sans-serif'; font-size: 15px; line-height: 19px;"><font size="2" color="#808080">DISCLAIMER</font><br /><font size="2" color="#808080"> Los procedimientos y pol&iacute;ticas de Recursos Humanos se han establecido a discreci&oacute;n de la compa&ntilde;&iacute;a, la compa&ntilde;&iacute;a podr&aacute; modificar o suprimirlas en cualquier momento sin tener que notificar o pedir consentimiento a los trabajadores, siento las &uacute;ltimas divulgadas las que prevalecen. Con respecto a los procedimientos de HR, debe indicarse que el v&iacute;nculo entre la empresa y el usuario no constituye una relaci&oacute;n contractual (ii) Todas las preguntas y respuestas y descripciones ofrecidas a trav&eacute;s del portal de Recursos Humanos se consideran &uacute;nicamente informaci&oacute;n general. Se recomienda a los empleados a solicitar el correspondiente plan de prestaciones para contrastar los derechos y los t&eacute;rminos y condiciones de los mismos. El contrato oficial y legislaci&oacute;n aplicable prevalecer&aacute; ante cualquier inconsistencia o posible errata en la informaci&oacute;n proporcionada en dichos documentos.</font></p>


                      </td>


              </tr>


      </tbody>


</table>


<div style="background-color: #ffffff; -webkit-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; border-top: 0px solid #cccccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 1px solid #cccccc;"><br />  </div>


<p>  </p>


<p>  </p>


<p>  </p>