Mail template gets modified

I tried to add a signature with HTML in my mail templates (invoices & quotes). Problem is that I save the template and when it reloads, the signature is altered.

I also tried to send a test email by creating a quote, then “send mail”. The saved (wrong) mail and signature are selected. When I try to “send now”, I get a red error that says “message body empty”.

Anybody has a clue what’s going on?

Could you please specify what is altered?

This is prepended: <span class="sceditor-selection sceditor-ignore" id="" "sceditor-end-marker"=""> </span>

This is my intro: "Beste, " (= Dear,)

This gets put inbetween: <br><br><span class="sceditor-selection sceditor-ignore" id "sceditor-end-marker"> </span><span class="sceditor-selection sceditor-ignore" id="sceditor-start-marker"> </span>

This is an example of some html that I added, but with everything in the tags stripped + contents and closing tags removed: <div ><span >

Well this is related to the HTML Editor itself but should not affect how the output is displayed.

Ok but what about the last part? The html that got stripped. That shouldn’t happen, right? Or are certain tags not allowed? If so, how to enable them?

Everything is allowed.
If you want to have full controll on your templates simply use the source code view.

What you suggested, is exactly what I did, I pasted my code in the source code view, then switched back to the wysiwyg view, all looks fine! Then I hit the “save” button and the layout is messed up because in the saving process, somehow the html tags got stripped. Sometimes I also notice comma’s that disappear or random spaces that are added in my text.

What I now did as a temporary solution: I changed the email template directly in the database. Then I browsed to a quote, clicked “send mail”. The values that I entered in the database, appear correctly in the editor view this time. Then I click “send mail”. This now correctly sends a mail, however once again, the mail arrives with the html partly messed up.

There is definitely something wrong with the editor.

Well I tested the editor with various HTML templates, with several formattings and with saving the templates and not a single one got messed up so it was broken afterwards…?!

heh i have to write here so i dont open new…

old e-mail templates (after upgrade from 1.2 to 1.3) are gone…

new ones if i enter, they disapear … and i cant get any template to work… always empty when i go to sending pdf to e-mail and chose e-mail template…

also i notices, if i enter customer name lets say… UO “SOMETHING” everything after first " disapears…

also, Invoice Plane works with php 5.3.3 , 5.4 and 5.5, but custom PDF generation does not work with php 5.4 and 5.5… only 5.3.3 … default template is generated with any php version, i just get white page

[size=10]Last Update 03.05.2015 (mark as fixed)[/size]

Could you please send me the template you are using to mail@invoiceplane.com (text file or something) so I can test this.

no problem…

Also sent my template. Kovah tested this and indeed there is something wrong with the processing of the contents. I hope it gets fixed in next release. I’d like to start using the mail feature. :smiley:

Hello,

I tested the new version 1.3.2 and unfortunately I have some bad news, the template still shows up stripped after I SAVE a new email template.

What I did: updated to 1.3.2, ran setup. All went fine. I also hit ctrl-f5 to clear browser cache.

It displays fine if I go to phpmyadmin and paste the HTML just like I want it Then I reload the invoiceplane emailtemplate preview screen and all looks fine. If I mail this as-is, it still ends up stripped in my mailbox.

Next, If I create a new emailtemplate, or edit an existing emailtemplate and SAVE it, the result is a stripped down version. An example of how some tags end up:

<td colspan="2"> <p  class "banner-container"><div ><span >... etcetera

Should be:

<td colspan="2"> <p style="font-family: Helvetica,Arial,sans-serif;" class="banner-container"><div style="width: 420px; height: 35px; color: #fff; padding:0; margin-top:12px; font-size: 12px;"><span style="background-color: #26364F; font-size: 20px; font-weight: bold; padding: 6px 16px 10px 16px;">... etcetera

Some questions: Is it a framework issue? Why does it go wrong upon saving? Why do style="" tags get stripped?

No there is no framework or something else used to save the Email templates.
The problem could be the internal handling and escaping of input content by Codeigniter itself. I couldn’t find any solution for this.

That’s what I meant with framework, codeigniter. If it’s true that this is the problem… that sucks! :frowning: I guess I’ll have to wait for the new version 2 with a different framework, to start using the mail template function.

You can just remove something like the footer with hundreds of elements and styles and use the mail templates with some simple styles.

I’m aware of that but I require a uniform appearance for my business… I’m mailing with my CRM system, mail client, smartphone, etc… and they all use this html signature successfully.

Invoiceplane has issues with it so I won’t be able to use the mail function yet because of this bug. It would be great if it got fixed some day but I can patiently wait until version 2 comes out with the new code framework. :slight_smile: Hope it won’t have the same issues though lol. :smiley:

PS don’t get me wrong I’m not complaining, I’m still very grateful for this wonderful application so all props to you for making it happen!

I think I fixed this problem.
@Laurens could you send me your signature again, can’t find it anymore so I can test it again.

Hello Kovah, glad to hear from you. This is the code you requested regarding the mail template.

http://pastebin.com/MiJZ4Frf

What exactly was the problem if I may ask?
Kind regards!