Post by LeorLindel » Fri Oct 14, 2011 11:48 pm

For v1.5.1.+ & next

So that special characters are readable by the client after the email account creation, you must:

In the file: catalog/model/account/customer.php

Replace these lines:

Code: Select all

      $mail->setSubject($subject);
      $mail->setText($message);
By them:

Code: Select all

      $mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
      $mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));

Tous les packs de langues Française depuis la v1.4.7 et toutes les versions intégrales 100 % Français sont disponibles sur le Portail Officiel Français.

Image


User avatar
Active Member

Posts

Joined
Mon Feb 22, 2010 8:05 pm

Post by LeorLindel » Tue Nov 08, 2011 8:02 pm

I go back on that, because many files are involved, such as:

admin/controller/common/forgotten.php
admin/model/sale/affiliate.php
admin/model/sale/customer.php
admin/model/sale/order.php
admin/model/sale/return.php
catalog/controller/account/forgotten.php
catalog/controller/affiliate/forgotten.php
catalog/model/account/customer.php
catalog/model/affiliate/affiliate.php
catalog/model/checkout/order.php


For all these files must be replaced:

Code: Select all

$mail->setSubject($subject);
by:

Code: Select all

$mail->setSubject(html_entity_decode($subject, ENT_QUOTES, 'UTF-8'));
and:

Code: Select all

$mail->setText($message);
by:

Code: Select all

$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
It would be helpful if these bugs can be fixed in future versions because many languages use accented characters.

Sorry for my bad english.

Tous les packs de langues Française depuis la v1.4.7 et toutes les versions intégrales 100 % Français sont disponibles sur le Portail Officiel Français.

Image


User avatar
Active Member

Posts

Joined
Mon Feb 22, 2010 8:05 pm

Post by Daniel » Tue Nov 08, 2011 8:56 pm

you might as well alter the mail class:

Code: Select all

	public function setTo($to) {
		$this->to = html_entity_decode($to, ENT_NOQUOTES, 'UTF-8');
	}

	public function setFrom($from) {
		$this->from = html_entity_decode($from, ENT_NOQUOTES, 'UTF-8');
	}

	public function setSender($sender) {
		$this->sender = html_entity_decode($sender, ENT_NOQUOTES, 'UTF-8');
	}

	public function setSubject($subject) {
		$this->subject = html_entity_decode($subject, ENT_NOQUOTES, 'UTF-8');
	}

	public function setText($text) {
		$this->text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
	}

	public function setHtml($html) {
		$this->html = html_entity_decode($html, ENT_NOQUOTES, 'UTF-8');
	}

	public function addAttachment($file, $filename = '') {
		if (!$filename) {
			$filename = basename($file);
		}
				
		$this->attachments[] = array(
			'filename' => html_entity_decode($filename, ENT_NOQUOTES, 'UTF-8'),
			'file'     => html_entity_decode($file, ENT_NOQUOTES, 'UTF-8')
		);
	}


OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by LeorLindel » Tue Nov 08, 2011 9:11 pm

Indeed, I thank you, but this change you it will be included in future releases?

Tous les packs de langues Française depuis la v1.4.7 et toutes les versions intégrales 100 % Français sont disponibles sur le Portail Officiel Français.

Image


User avatar
Active Member

Posts

Joined
Mon Feb 22, 2010 8:05 pm

Post by Daniel » Tue Nov 08, 2011 9:21 pm

actually i'm trying to think the best way.

the only reason we need html_entity_decode is because all input from the request is html coded.

maybe better to do it on the out side.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by olandese » Wed Dec 14, 2011 7:31 pm

Hi,

i'm have the same problem with the mails. I installed the italian language. It would be nice to fix this problem out of the box in the next versions.

Newbie

Posts

Joined
Mon Dec 12, 2011 11:17 pm

Post by SelfMan » Thu May 17, 2012 5:49 pm

Any progress on this?

New member

Posts

Joined
Thu Dec 01, 2011 8:01 am

Post by Daniel » Thu May 17, 2012 8:15 pm

yes it was fixed along time ago.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by SelfMan » Thu May 17, 2012 9:17 pm

As far as I can see the change you proposed here is not applied in system\library\mail.php (in SVN)
which I placed in our 1.5.1.3 version.
If you don't mind, can you point me to where this has been fixed?

New member

Posts

Joined
Thu Dec 01, 2011 8:01 am

Post by joeblack » Thu Sep 04, 2014 5:06 am

it seems like more than two years have passed by since the last post in this thread... and guess what, i just ran into the exact same problem :o

Newbie

Posts

Joined
Thu Sep 04, 2014 5:01 am
Who is online

Users browsing this forum: No registered users and 11 guests