Author Topic: Order confirmation emails distorted layout - quoted printable issue  (Read 1250 times)

Frans D

  • Jr. Member
  • **
  • Posts: 64
Joomla Version: Joomla! 3.6.0 Stable [ Noether ] 12-July-2016 21:14 GMT
Virtuemart Version: VirtueMart 3.0.16

Problem:
Order confirmation emails have blank spaces in their source, which destroys the layout and give blank spaces in words.
So for example you'll see "Your o rder number" instead of "Your order number".
And codes like;
Code: [Select]
< td valign="top" width="290" style="border: 1px solid #CCCCCC;"> Instead of:
Code: [Select]
<td valign="top" width="290" style="border: 1px solid #CCCCCC;">
The cause of the problem is that suddenly (in April 2016) emails started to be send with;
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Instead of the usual;
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

This resulted in source codes like;
Code: [Select]
=0A<tr>=0A<td align=3D"left" style=3D"border: 1px solid #CCCCCC;">=0AYour o=

rder number: <br />=0A<strong>N1VG041</strong>=0A</td>=0A<td align=3D"left"=
I searched upon how quoted-printable should work and normally the = sign should connect the code to the following line.
However between each line, there is an empty line, so that just doesn't work.

I did nothing to change this myself, from one to another day "quoted printable" was used.
Only order emails have this problems, emails like "ask a question" are send normally and have a normal layout.
So we tried already a reinstall of VM, depublishing a lot of components & Plugins and also another server, but nothing helped so far.

Does anyone know how to change the Content-Transfer-Encoding: quoted-printable back to the usual Content-Transfer-Encoding: 8bit?


jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27601
  • Always on vacation
    • Jenkin Hill Internet
Re: Order confirmation emails distorted layout - quoted printable issue
« Reply #1 on: July 17, 2016, 14:02:55 pm »
Just tested with J3.5.1 and J3.6 with VM3.0.17.2 on Protostar with defauilt VM templates, no overrides, using PHP Mail as Mailer in Joomla config. All order emails are:

Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit



Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.10.10211 on Joomla 3.9.13 PHP 7.0.33

Frans D

  • Jr. Member
  • **
  • Posts: 64
Re: Order confirmation emails distorted layout - quoted printable issue
« Reply #2 on: July 17, 2016, 14:13:27 pm »
Hi Jenkinhill,

Thanks for the reply and test.
We tested also with no overrides and using PHP Mail as mailer, but still the problem is present.
We're a bit lost were to look for the cause of the problem and are hoping that someone could give us a push in the right direction.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27601
  • Always on vacation
    • Jenkin Hill Internet
Re: Order confirmation emails distorted layout - quoted printable issue
« Reply #3 on: July 17, 2016, 14:39:15 pm »
Check the Joomla file /libraries/vendor/phpmailer/phpmailer/class.phpmailer.php

Around line 60 the encoding is set. Mine shows:

public $Encoding = '8bit';
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.10.10211 on Joomla 3.9.13 PHP 7.0.33

Frans D

  • Jr. Member
  • **
  • Posts: 64
Re: Order confirmation emails distorted layout - quoted printable issue
« Reply #4 on: July 17, 2016, 18:50:12 pm »
Hi,

Thanks, but I looked already at that line before, it is set on 8bit.

Frans D

  • Jr. Member
  • **
  • Posts: 64
Re: Order confirmation emails distorted layout - quoted printable issue
« Reply #5 on: July 17, 2016, 20:10:36 pm »
I finally seem to have found the cause.
I was trying again a few things and when I unmark the footer at shop > invoice/emails normal emails are send.
So the problem is within the footer I am using for the pdf emails, the same footer is also shown in the emails.
Strangest thing of all is; that I am using this footer already for a while and before there were no problems.

So this is an example of the footer I am using;
Code: [Select]
<table cellspacing="5">
<tbody>
<tr>
<td style="width: 180px;">
<p><strong>Webshop Name</strong><br />is part of:<br /><br /><strong>Company name</strong><br />Street name<br />ZIP City<br />Country</p>
<p>&nbsp;</p>
<p>Tel1: 0099- 123 456 789<br />Tel2: 0098- 123 456 789<br />Fax: 0099- 321 456 789<br />E-mail: <a href="mailto:info@myemail.com">info@myemail.com</a>&nbsp;</p>
</td>
<td style="width: 320px;">
<p style="text-align: center;">Leveringen geschieden volgens de algemene verkoopvoorwaarden.<br />Zoals door company gedeponeerd bij<br />..............<br />Sales and delivery terms filed at the Chamber of Commerce,<br />..............<br />...........<br />BTW &ndash; VAT &ndash; MwSt &ndash;TVA nr: ZZ 1234-555-666</p>
<p style="text-align: center;">&nbsp;</p>
<p style="text-align: center;"><a href="http://www.mywebsite.com">www.mywebsite.com</a>&nbsp;</p>
</td>
<td style="width: 250px;">
<p>Betalingen aan:<br /><strong>My Company</strong></p>
<p><br />ffffffffffffffff;<br />NR&nbsp;888085189045<br />IBAN nr.&nbsp;ZZ75167760751<br />BIC: MNGFDXCH</p>
<p>&nbsp;</p>
<p>Bank name - City;<br />NR 826755878745<br />IBAN nr. ZZ567368 8448<br />BIC: GHPFDD&nbsp;</p>
</td>
</tr>
</tbody>
</table>

Does anybody know what I have to change, so I can still use this layout?

Frans D

  • Jr. Member
  • **
  • Posts: 64
Re: Order confirmation emails distorted layout - quoted printable issue
« Reply #6 on: July 17, 2016, 22:53:27 pm »
Ok, got it.
I used a 3 column table footer and changed it now into 2 columns and everything functions normal again.
Before April 2016 I could use the 3 column footer without any problems.
So somewhere down the line probably a Joomla core file has been changed, which caused that you can't use 3 columns in the footer anymore.