Mail template gets modified

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!

Sorry if I am misunderstanding but is this fix supposed to be included in the current version 1.4.0?
Because if it is, I am still facing the issue that the e-mail template isn’t being saved to the database. Even though InvoicePlane reports ‘Record successfully updated’.

Here is a link to the closed topic including the e-mail template I’m trying to use: https://community2.invoiceplane.com/t/duplicate-e-mail-template-parser-editor-injection/838

I think this is the link to the commit related to this issue: https://github.com/InvoicePlane/InvoicePlane/commit/07a181c5d1ffeeb75525ad78e6bbe2bbc397c2f8

However as I mentioned in my comment below (https://community2.invoiceplane.com/t/mail-template-gets-modified/738/21?u=flightkick) the problem stil exists for me, or it might be just another parsing issue related to my specific template.

I can also confirm that the issue still exists for me in 1.4.0. I presumed the issue was gone but didn’t have a chance to test it really. Now tested and indeed issue still exists. I also asked what exactly was wrong but no answer yet. Sooner or later this will get fixed, until that moment I’m not using the mailing function.